Merge branch 'master' of github.com:hadley/r4ds

This commit is contained in:
hadley 2016-03-25 07:59:12 -05:00
commit b912e0e0fd
2 changed files with 2 additions and 2 deletions

View File

@ -452,7 +452,7 @@ flights %>%
patterns?
1. What does `anti_join(flights, airports, by = c("dest" = "faa"))` tell you?
What does `anti_join(airports, flights, by = c("dest" = "faa"))` tell you?
What does `anti_join(airports, flights, by = c("faa" = "dest"))` tell you?
## Join problems

View File

@ -598,7 +598,7 @@ delays <- flights %>%
dist = mean(distance, na.rm = TRUE),
delay = mean(arr_delay, na.rm = TRUE)
) %>%
filter(delay, count > 20, dest != "HNL")
filter(count > 20, dest != "HNL")
```
This focuses on the transformations, not what's being transformed, which makes the code easier to read. You can read it as a series of imperative statements: group, then summarise, then filter. As suggested by this reading, a good way to pronounce `%>%` when reading code is "then".