Data Science Desktop Survival Guide
by Graham Williams |
|||||
Pipeline Construction |
# Summarise subset of variables for observations with rainfall.
ds %>% select(min_temp, max_temp, rainfall, sunshine) %>% filter(rainfall >= 1) %>% summary()
It could be useful to contrast this with a base::summary() of those observations where there was little or no rain. |
# Summarise observations with little or no rainfall.
ds %>% select(min_temp, max_temp, rainfall, sunshine) %>% filter(rainfall < 1) %>% summary()
Any number of functions can be included in a pipeline to achieve the results we desire. In the following chapters we will see many examples and some will string together ten or more functions. Each step along the way is of itself generally easily understandable. The power is in what we can achieve by stringing together many simple steps to produce something more complex. |