diff --git a/data-tidy.Rmd b/data-tidy.Rmd index 9733bf3..761406c 100644 --- a/data-tidy.Rmd +++ b/data-tidy.Rmd @@ -71,7 +71,7 @@ There are two main advantages: If you have a consistent data structure, it's easier to learn the tools that work with it because they have an underlying uniformity. 2. There's a specific advantage to placing variables in columns because it allows R's vectorised nature to shine. - As you learned in Sections \@ref(mutate-funs) and \@ref(summarise-funs), most built-in R functions work with vectors of values. + As you learned in Sections \@ref(mutate) and \@ref(summarise), most built-in R functions work with vectors of values. That makes transforming tidy data feel particularly natural. dplyr, ggplot2, and all the other packages in the tidyverse are designed to work with tidy data. diff --git a/data-transform.Rmd b/data-transform.Rmd index 1745674..2dc38f0 100644 --- a/data-transform.Rmd +++ b/data-transform.Rmd @@ -208,7 +208,7 @@ flights |> There are four important verbs that affect the columns without changing the rows: `mutate()`, `select()`, `rename()`, and `relocate()`. `mutate()` creates new columns that are functions of the existing columns; `select()`, `rename()`, and `relocate()` change which columns are present, their names, or their positions. -### `mutate()` +### `mutate()` {#mutate} The job of `mutate()` is to add new columns that are calculated from the existing columns. In the transform chapters, you'll learn a large set of functions that you can use to manipulate different types of variables. @@ -396,7 +396,7 @@ flights |> `group_by()` doesn't change the data but, if you look closely at the output, you'll notice that it's now "grouped by" month. This means subsequent operations will now work "by month". -### `summarise()` +### `summarise()` {#summarise} The most important grouped operation is a summary. It collapses each group to a single row[^data-transform-3]. diff --git a/logicals-numbers.Rmd b/logicals-numbers.Rmd index f203661..4eba151 100644 --- a/logicals-numbers.Rmd +++ b/logicals-numbers.Rmd @@ -76,7 +76,7 @@ As well as `&` and `|`, R also has `&&` and `||`. Don't use them in dplyr functions! These are called short-circuiting operators and you'll learn when you should use them in Section \@ref(conditional-execution) on conditional execution. -### Missing values +### Missing values {#logical-missing} `filter()` only selects rows where the logical expression is `TRUE`; it doesn't select rows where it's missing or `FALSE`. If you want to find rows containing missing values, you'll need to convert missingness into a logical vector using `is.na()`. diff --git a/whole-game.Rmd b/whole-game.Rmd index 605af98..374909f 100644 --- a/whole-game.Rmd +++ b/whole-game.Rmd @@ -30,5 +30,5 @@ In this part of the book you will learn some useful tools that have an immediate Modelling is an important part of the exploratory process, but you don't have the skills to effectively learn or apply it yet and details of modeling fall outside the scope of this book. Nestled among these five chapters that teach you the tools for doing data science are three chapters that focus on your R workflow. -In Chapters \@ref(workflow-basics), \@ref(workflow-scripts), and \@ref(workflow-projects), you'll learn good workflow practices for writing and organising your R code. +In Chapters \@ref(workflow-basics), \@ref(workflow-pipes), \@ref(workflow-style), and \@ref(workflow-scripts-projects), you'll learn good workflow practices for writing and organising your R code. These will set you up for success in the long run, as they'll give you the tools to stay organised when you tackle real projects. diff --git a/workflow-scripts.Rmd b/workflow-scripts.Rmd index dd76e97..b08e291 100644 --- a/workflow-scripts.Rmd +++ b/workflow-scripts.Rmd @@ -1,4 +1,4 @@ -# Workflow: scripts and projects +# Workflow: scripts and projects {#workflow-scripts-projects} ```{r, results = "asis", echo = FALSE} status("restructuring") @@ -74,7 +74,7 @@ RStudio will also let you know about potential problems: knitr::include_graphics("screenshots/rstudio-diagnostic-warn.png") ``` -# Workflow: projects +## Workflow: projects One day you will need to quit R, go do something else and return to your analysis the next day. One day you will be working on multiple analyses simultaneously that all use R and you want to keep them separate.