Tidy chapter updates
This commit is contained in:
@@ -245,7 +245,7 @@ arrange(df, desc(x))
|
||||
|
||||
1. Which flights travelled the longest? Which travelled the shortest?
|
||||
|
||||
## Select columns with `select()`
|
||||
## Select columns with `select()` {#select}
|
||||
|
||||
It's not uncommon to get datasets with hundreds or even thousands of variables. In this case, the first challenge is often narrowing in on the variables you're actually interested in. `select()` allows you to rapidly zoom in on a useful subset using operations based on the names of the variables.
|
||||
|
||||
@@ -355,7 +355,7 @@ transmute(flights,
|
||||
)
|
||||
```
|
||||
|
||||
### Useful functions
|
||||
### Useful creation functions
|
||||
|
||||
There are many functions for creating new variables that you can use with `mutate()`. The key property is that the function must be vectorised: it must take a vector of values as input, return a vector with the same number of values as output. There's no way to list every possible function that you might use, but here's a selection of functions that are frequently useful:
|
||||
|
||||
@@ -655,7 +655,7 @@ batters %>% arrange(desc(ba))
|
||||
|
||||
You can find a good explanation of this problem at <http://varianceexplained.org/r/empirical_bayes_baseball/> and <http://www.evanmiller.org/how-not-to-sort-by-average-rating.html>.
|
||||
|
||||
### Other summary functions
|
||||
### Useful summary functions
|
||||
|
||||
Just using means, counts, and sum can get you a long way, but R provides many other useful summary functions:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user