The pipeline
warpbreaks %>%
group_by(wool, tension) %>%
summarise_at(vars(breaks), list(~mean(.), ~median(.), ~sd(.)))
Could someone interpret the summarise_at()
part of the code for me?
The pipeline
warpbreaks %>%
group_by(wool, tension) %>%
summarise_at(vars(breaks), list(~mean(.), ~median(.), ~sd(.)))
Could someone interpret the summarise_at()
part of the code for me?
summarize_at(vars, function)
The first argument vars() to summarize_at lets you select the specific set of variables that you would like to perform the function on.
In your case, your code will get the mean, median, and standard deviation for the breaks variable in a list form.