November 2017
Beginner to intermediate
204 pages
5h 23m
English
Part of the expressive power of dplyr comes from its ability to chain data processing operations one after the other. The %>% symbol can be used with dplyr functions to chain together operations. The way it works is that the result of all of the expression before the %>% symbol is used as the first argument of the function that comes after the %>% symbol. In the following demonstration, I use the %>% symbol to put together the select and arrange operations:
vehicles.product.arranged <- as_tibble( vehicles %>% ## start with the original data select(make,model,year,cylinders) %>% ## select the columns arrange(make,model,year) ## arrange the rows)
The previous chain of operations starts with the vehicles dataframe ...
Read now
Unlock full access