From 61a4ce719dd637ba52dc2db94155f64e33fb78db Mon Sep 17 00:00:00 2001 From: Zeki Akyol <40212849+zekiakyol@users.noreply.github.com> Date: Mon, 13 Feb 2023 22:29:46 +0300 Subject: [PATCH] Improve sentences (#1279) It slightly improves sentences and fixes some typos. --- data-import.qmd | 2 +- data-tidy.qmd | 2 +- data-transform.qmd | 4 ++-- data-visualize.qmd | 2 +- visualize.qmd | 2 +- workflow-basics.qmd | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data-import.qmd b/data-import.qmd index ef5e70b..cdf3df2 100644 --- a/data-import.qmd +++ b/data-import.qmd @@ -502,7 +502,7 @@ We'll use `tibble()` and `tribble()` later in the book to construct small exampl In this chapter, you've learned how to load CSV files with `read_csv()` and to do your own data entry with `tibble()` and `tribble()`. You've learned how csv files work, some of the problems you might encounter, and how to overcome them. -We'll come to data import a few times in this book: @sec-import-spreadsheets from Excel and googlesheets, @sec-import-databases will show you how to load data from databases, @sec-arrow from parquet files, @sec-rectangling from JSON, and @sec-scraping from websites. +We'll come to data import a few times in this book: @sec-import-spreadsheets from Excel and Google Sheets, @sec-import-databases will show you how to load data from databases, @sec-arrow from parquet files, @sec-rectangling from JSON, and @sec-scraping from websites. Now that you're writing a substantial amount of R code, it's time to learn more about organizing your code into files and directories. In the next chapter, you'll learn all about the advantages of scripts and projects, and some of the many tools that they provide to make your life easier. diff --git a/data-tidy.qmd b/data-tidy.qmd index fdcecb6..059843a 100644 --- a/data-tidy.qmd +++ b/data-tidy.qmd @@ -397,7 +397,7 @@ household ``` This dataset contains data about five families, with the names and dates of birth of up to two children. -The new challenge in this dataset is that the column names contain the names of two variables (`dob`, `name)` and the values of another (`child,` with values 1 and 2). +The new challenge in this dataset is that the column names contain the names of two variables (`dob`, `name)` and the values of another (`child,` with values 1 or 2). To solve this problem we again need to supply a vector to `names_to` but this time we use the special `".value"` sentinel. This overrides the usual `values_to` argument to use the first component of the pivoted column name as a variable name in the output. diff --git a/data-transform.qmd b/data-transform.qmd index f4889a1..4851055 100644 --- a/data-transform.qmd +++ b/data-transform.qmd @@ -278,7 +278,7 @@ flights |> The `.` is a sign that `.before` is an argument to the function, not the name of a new variable. You can also use `.after` to add after a variable, and in both `.before` and `.after` you can use the variable name instead of a position. -For example, we could add the new variables after `day:` +For example, we could add the new variables after `day`: ```{r} flights |> @@ -307,7 +307,7 @@ flights |> It's not uncommon to get datasets with hundreds or even thousands of variables. In this situation, the first challenge is often just focusing on the variables you're interested in. `select()` allows you to rapidly zoom in on a useful subset using operations based on the names of the variables. -`select()` is not terribly useful with the flights data because we only have 19 variables, but you can still get the general idea of how it works: +`select()` is not terribly useful with the `flights` data because we only have 19 variables, but you can still get the general idea of how it works: ```{r} # Select columns by name diff --git a/data-visualize.qmd b/data-visualize.qmd index 2a01ba7..ed60cf9 100644 --- a/data-visualize.qmd +++ b/data-visualize.qmd @@ -473,7 +473,7 @@ ggplot(penguins, aes(x = flipper_length_mm, y = body_mass_g)) + geom_point() ``` -In the future, you'll also learn about the pipe which will allow you to create that plot with: +In the future, you'll also learn about the pipe, `|>`, which will allow you to create that plot with: ```{r} #| eval: false diff --git a/visualize.qmd b/visualize.qmd index 8120e78..952e528 100644 --- a/visualize.qmd +++ b/visualize.qmd @@ -33,7 +33,7 @@ Each chapter addresses one to a few aspects of creating a data visualization. ### Learning more -The absolute best place to learn more is the ggplot2 book: [*ggplot2: Elegant graphics for data analysis*](https://ggplot2-book.org/). +The absolute best place to learn more is the ggplot2 book: [*ggplot2: Elegant graphics for data analysis (3e)*](https://ggplot2-book.org/). It goes into much more depth about the underlying theory, and has many more examples of how to combine the individual pieces to solve practical problems. Another great resource is the ggplot2 extensions gallery . diff --git a/workflow-basics.qmd b/workflow-basics.qmd index 4796140..3b2a03f 100644 --- a/workflow-basics.qmd +++ b/workflow-basics.qmd @@ -62,7 +62,7 @@ Code is miserable to read on a good day, so giveyoureyesabreak and use spaces. ## Comments -R will ignore any text after `#`. +R will ignore any text after `#` for that line. This allows you to write **comments**, text that is ignored by R but read by other humans. We'll sometimes include comments in examples explaining what's happening with the code. @@ -133,7 +133,7 @@ Change 2.5 to 3.5 and rerun. Make yet another assignment: ```{r} -r_rocks <- 2 ^ 3 +r_rocks <- 2^3 ``` Let's try to inspect it: