Data Science Desktop Survival Guide
by Graham Williams |
|||||
Exposition Pipe |
%$%
. This is
the exposition pipe which is also useful for commands that do not take
a dataset as their argument but instead some columns from the
dataset. It evaluates the following function within the context of the
dataset passed to it, so that the variables of the dataset become
available without the need to quote them
ds %>%
filter(rainfall==0) %$% cor(min_temp, max_temp)
We might otherwise use with. |
ds %>%
filter(rainfall==0) %>% with(cor(min_temp, max_temp))
|