Skip to content

Commit e707131

Browse files
committed
Improve example
1 parent b109e9f commit e707131

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

R/aes-evaluation.r

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,14 @@
9090
#' ggplot(mpg, aes(class, hwy)) +
9191
#' geom_boxplot(aes(fill = stage(class, after_scale = alpha(fill, 0.4))))
9292
#'
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
9594
#' ggplot(mpg, aes(class, displ)) +
9695
#' geom_violin() +
9796
#' stat_summary(
9897
#' aes(y = stage(displ, after_stat = 8),
99-
#' label = after_stat(paste(y, ymax, sep = " ± "))),
98+
#' label = after_stat(paste(mean, "±", sd))),
10099
#' geom = "text",
101-
#' fun = ~ round(mean(.x), 2),
102-
#' fun.max = ~ round(sd(.x), 2)
100+
#' fun.data = ~ round(data.frame(mean = mean(.x), sd = sd(.x)), 2)
103101
#' )
104102
#' ```
105103
#'

0 commit comments

Comments
 (0)