I have a boxplot showing multiple boxes. I want to connect the mean for each box together with a line. The boxplot does not display the mean by default, instead the middle line only indicates the median. I tried
ggplot(data, aes(x=xData, y=yData, group=g))
+ geom_boxplot()
+ stat_summary(fun.y=mean, geom="line")
This does not work.
Interestingly enough, doing
stat_summary(fun.y=mean, geom="point")
draws the median point in each box. Why would "line" not work?
Something like this but using ggplot2, http://www.aliquote.org/articles/tech/RMB/c4_sols/plot45.png
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…