stat_median_ci | R Documentation |
Convenient function for calculating the median confidence interval. It can be used as a ggplot
helper
function for plotting.
stat_median_ci(x, conf_level = 0.95, na.rm = TRUE, gg_helper = TRUE)
x |
( |
conf_level |
( |
na.rm |
( |
gg_helper |
( |
This function was adapted from DescTools/versions/0.99.35/source
A named vector
of values median_ci_lwr
and median_ci_upr
.
stat_median_ci(sample(10), gg_helper = FALSE)
p <- ggplot2::ggplot(mtcars, ggplot2::aes(cyl, mpg)) +
ggplot2::geom_point()
p + ggplot2::stat_summary(
fun.data = stat_median_ci,
geom = "errorbar"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.