I would like to do a boxplot
with two different groups with only three different measurements (is that even possible?). Here is my data:
data <- data.frame( "County" = 1:6, Median = c(5,7,8,2,4, 5), Low = c( 0.5,2,4,1,2,3),
High = c(10,12,11,9,10,15), ID = c("TRUE", "TRUE", "FALSE", "TRUE", "FALSE", "FALSE"))
I would like to create a boxplot
with County on the x-axis, median, low and high on the y-axis, and ID (either true/false) as fill. As a result, I want six different (in this case) boxplots (three false and three true). But I am not sure how to do this with my data, since I don't have ymin
and ymax
.
I have tried this, but it does not take lower and upper into account:
ggplot(dat, aes(x = County, y = Median, lower = Low, upper = High, fill = ID)) +
geom_boxplot()
Have anyone experienced the same problem?