From 6edfe2c9ed4c8d3d282b781e09d13fc91a7e316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Guillou?= Date: Wed, 20 Jun 2018 19:10:59 +1000 Subject: [PATCH] minor typos in chapter 5 (#666) --- transform.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transform.Rmd b/transform.Rmd index 676de52..7517775 100644 --- a/transform.Rmd +++ b/transform.Rmd @@ -101,7 +101,7 @@ There's another common problem you might encounter when using `==`: floating poi ```{r} 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()`: @@ -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 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. ```{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 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. 1. Look at each destination. Can you find flights that are suspiciously