Description Usage Arguments Examples
Apply a Function over a long-form dataset column by variable.
1 |
df |
|
col_expr |
|
col_n |
|
fn |
1 2 3 4 5 6 7 8 9 10 | data <- SPPdispersion
avg <- lfapply(data, reflection, angle, mean)
se <- lfapply(data, reflection, angle, sd) / sqrt(20)
ymin <- avg - se
ymax <- avg + se
result <- tibble(step = 1:225, avg, se, ymin, ymax)
ggplot(result, aes(step, avg, ymin = ymin, ymax = ymax)) + geom_line() +
geom_errorbar()+theme_bw()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.