Skip to content

Commit

Permalink
Chapter 13 (numbers): minor updates (hadley#1627)
Browse files Browse the repository at this point in the history
* numbers.qmd: improve variable name for IQR

* numbers.qmd: textual fix
  • Loading branch information
florisvdh authored Feb 2, 2024
1 parent 716cc5b commit f40e78a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numbers.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,11 @@ But the code below reveals a data oddity for airport [EGE](https://en.wikipedia.
flights |>
group_by(origin, dest) |>
summarize(
distance_sd = IQR(distance),
distance_iqr = IQR(distance),
n = n(),
.groups = "drop"
) |>
filter(distance_sd > 0)
filter(distance_iqr > 0)
```

### Distributions
Expand Down Expand Up @@ -717,7 +717,7 @@ Finally, don't forget what you learned in @sec-sample-size: whenever creating nu

There's one final type of summary that's useful for numeric vectors, but also works with every other type of value: extracting a value at a specific position: `first(x)`, `last(x)`, and `nth(x, n)`.

For example, we can find the first and last departure for each day:
For example, we can find the first, fifth and last departure for each day:

```{r}
flights |>
Expand Down

0 comments on commit f40e78a

Please sign in to comment.