From cca1cd4e070b85743ba8667032e949f2a455d573 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Wed, 8 Mar 2023 17:33:52 -0600 Subject: [PATCH] Minor fixes Fixes #1324 --- iteration.qmd | 2 +- layers.qmd | 2 -- numbers.qmd | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iteration.qmd b/iteration.qmd index 1cea9f7..bd98ac7 100644 --- a/iteration.qmd +++ b/iteration.qmd @@ -118,7 +118,7 @@ In simple cases, as above, this will be a single existing function. This is a pretty special feature of R: we're passing one function (`median`, `mean`, `str_flatten`, ...) to another function (`across`). This is one of the features that makes R a functional programming language. -It's important to note that we're passing this function to `across()`, so `across()` can call it, not calling it ourselves. +It's important to note that we're passing this function to `across()`, so `across()` can call it; we're calling it ourselves. That means the function name should never be followed by `()`. If you forget, you'll get an error: diff --git a/layers.qmd b/layers.qmd index 8d12a97..80557e2 100644 --- a/layers.qmd +++ b/layers.qmd @@ -383,8 +383,6 @@ ggplot(mpg, aes(x = displ, y = hwy)) + ) ``` -(You'll learn how `filter()` works in the chapter on data transformations: for now, just know that this command selects only the subcompact cars.) - Geoms are the fundamental building blocks of ggplot2. You can completely transform the look of your plot by changing its geom, and different geoms can reveal different features of your data. For example, the histogram and density plot below reveal that the distribution of highway mileage is bimodal and right skewed while the boxplot reveals two potential outliers. diff --git a/numbers.qmd b/numbers.qmd index 9c6715b..97f475a 100644 --- a/numbers.qmd +++ b/numbers.qmd @@ -639,7 +639,7 @@ We won't explain `sd()` here since you're probably already familiar with it, but We can use this to reveal a small oddity in the `flights` data. You might expect the spread of the distance between origin and destination to be zero, since airports are always in the same place. -But the code below makes it looks like one airport, [EGE](https://en.wikipedia.org/wiki/Eagle_County_Regional_Airport), might have moved. +But the code below reveals a data oddity for airport [EGE](https://en.wikipedia.org/wiki/Eagle_County_Regional_Airport): ```{r} flights |> @@ -773,6 +773,7 @@ For example: 3. Create a plot to further explore the adventures of EGE. Can you find any evidence that the airport moved locations? + Can you find another variable that might explain the difference? ## Summary