for some inane reason, I need to create a boxplot where the middle line is the mean instead of the median. I checked stackoverflow already and found examples of adding a mean line, but not exactly what I need. I tried using stat_smooth but no dice. Any ideas?
code below:
dust <- c(4.5, 3.7, 5, 5.2, 8.5, 6.6, 4.7, 5, 5.7, 4.3, 2.3, 7.6, 5.2,
6, 8.7, 7.5, 7.7, 11, 9, 6.5, 8.7, 5, 2.2, 7.5, 7.5, 3.5)
wind <- c("Present", "Absent", "Absent", "Absent", "Absent", "Absent",
"Absent", "Absent", "Absent", "Present", "Absent", "Absent",
"Present", "Present", "Absent", "Absent", "Absent", "Absent",
"Absent", "Present", "Absent", "Present", "Absent", "Absent",
"Absent", "Present")
df <- data.frame(dust,wind)
plot <- ggplot(data=df,aes(x=wind,y=dust))+geom_boxplot()+stat_smooth()
plot