I am wondering what is the idiomatic approach for constructing a ggplot2 boxplot given precomputated values for each boxplot
> df
base p10 p90 lower_quartile mean median upper_quartile
1 1 32 35 33 33.63740 34 34
2 2 32 35 33 33.77753 34 35
3 3 32 36 33 33.89361 34 35
4 4 33 36 33 33.89691 34 35
5 5 32 35 33 33.85145 34 35
6 6 35 37 37 36.48259 37 37
Attempting to draw these plots with
ggplot(df, aes(base)) +
geom_boxplot(aes(ymin = p10,
lower = lower_quartile,
middle = median,
upper = upper_quartile,
ymax = p90),
stat = "identity")
does not give the desired plots. What am I missing?
