# NOT RUN {
library(dplyr)
library(ggplot2)
data_frame(x = 1:10) %>%
group_by_all() %>%
do(data_frame(y = rnorm(100, .$x))) %>%
median_qi(.prob = c(.5, .8, .95)) %>%
ggplot(aes(x = x, y = y)) +
# automatically uses aes(ymin = conf.low, ymax = conf.high, fill = fct_rev(ordered(.prob)))
geom_lineribbon() +
scale_fill_brewer()
# }
Run the code above in your browser using DataLab