stat_mean_ci(sample(10), gg_helper = FALSE)
p <- ggplot2::ggplot(mtcars, ggplot2::aes(cyl, mpg)) +
ggplot2::geom_point()
p + ggplot2::stat_summary(
fun.data = stat_mean_ci,
geom = "errorbar"
)
p + ggplot2::stat_summary(
fun.data = stat_mean_ci,
fun.args = list(conf_level = 0.5),
geom = "errorbar"
)
p + ggplot2::stat_summary(
fun.data = stat_mean_ci,
fun.args = list(conf_level = 0.5, geom_mean = TRUE),
geom = "errorbar"
)
Run the code above in your browser using DataLab