File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 90
90
# ' ggplot(mpg, aes(class, hwy)) +
91
91
# ' geom_boxplot(aes(fill = stage(class, after_scale = alpha(fill, 0.4))))
92
92
# '
93
- # ' # Using data for computing summary, but placing label elsewhere, as well as
94
- # ' # using the computed 'y' as part of the label.
93
+ # ' # Using data for computing summary, but placing label elsewhere.
94
+ # ' # Also, we're making our own computed variable to use for the label.
95
95
# ' ggplot(mpg, aes(class, displ)) +
96
96
# ' geom_violin() +
97
97
# ' stat_summary(
98
98
# ' aes(y = stage(displ, after_stat = 8),
99
- # ' label = after_stat(paste(y, ymax, sep = " ± " ))),
99
+ # ' label = after_stat(paste(mean, "±", sd ))),
100
100
# ' geom = "text",
101
- # ' fun = ~ round(mean(.x), 2),
102
- # ' fun.max = ~ round(sd(.x), 2)
101
+ # ' fun.data = ~ round(data.frame(mean = mean(.x), sd = sd(.x)), 2)
103
102
# ' )
104
103
# ' ```
105
104
# '
You can’t perform that action at this time.
0 commit comments