minor typos in chapter 5 (#666)

This commit is contained in:
Stéphane Guillou 2018-06-20 19:10:59 +10:00 committed by Hadley Wickham
parent c7a2442f64
commit 6edfe2c9ed
1 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ There's another common problem you might encounter when using `==`: floating poi
```{r} ```{r}
sqrt(2) ^ 2 == 2 sqrt(2) ^ 2 == 2
1/49 * 49 == 1 1 / 49 * 49 == 1
``` ```
Computers use finite precision arithmetic (they obviously can't store an infinite number of digits!) so remember that every number you see is an approximation. Instead of relying on `==`, use `near()`: Computers use finite precision arithmetic (they obviously can't store an infinite number of digits!) so remember that every number you see is an approximation. Instead of relying on `==`, use `near()`:
@ -389,7 +389,7 @@ There are many functions for creating new variables that you can use with `mutat
* Offsets: `lead()` and `lag()` allow you to refer to leading or lagging * Offsets: `lead()` and `lag()` allow you to refer to leading or lagging
values. This allows you to compute running differences (e.g. `x - lag(x)`) values. This allows you to compute running differences (e.g. `x - lag(x)`)
or find when values change (`x != lag(x))`. They are most useful in or find when values change (`x != lag(x)`). They are most useful in
conjunction with `group_by()`, which you'll learn about shortly. conjunction with `group_by()`, which you'll learn about shortly.
```{r} ```{r}
@ -882,7 +882,7 @@ Functions that work most naturally in grouped mutates and filters are known as
1. Delays are typically temporally correlated: even once the problem that 1. Delays are typically temporally correlated: even once the problem that
caused the initial delay has been resolved, later flights are delayed caused the initial delay has been resolved, later flights are delayed
to allow earlier flights to leave. Using `lag()` explore how the delay to allow earlier flights to leave. Using `lag()`, explore how the delay
of a flight is related to the delay of the immediately preceding flight. of a flight is related to the delay of the immediately preceding flight.
1. Look at each destination. Can you find flights that are suspiciously 1. Look at each destination. Can you find flights that are suspiciously