Chapter 13 (numbers): minor updates (#1627)

* numbers.qmd: improve variable name for IQR

* numbers.qmd: textual fix
This commit is contained in:
Floris Vanderhaeghe 2024-02-02 01:41:06 +01:00 committed by GitHub
parent 716cc5b5c5
commit f40e78af08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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
@ -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 |>