auto_wrap {ggplot2} | R Documentation |
Creates a new function which will operate correctly with stat_summary
.
auto_wrap(f)
f |
function to wrap |
stat_summary
assumes that summary functions take data.frames
as input, and return data frames as output. This function will convert
a function that takes a vector of values to the correct format.
Hadley Wickham <h.wickham@gmail.com>
sum_mean <- auto_wrap(mean) sum_mean(data.frame(y = 1:10))