I have a grouped boxplot with ggplot2 like this
p <- qplot(factor(cyl), mpg, data=mtcars, geom=\"boxplot\", fill=factor(gear))
and I wa
You should set position to position_dodge() and width to 0.75 - so points will be placed in the same way as boxplots.
position_dodge()
width
qplot(factor(cyl), mpg, data=mtcars, geom="boxplot", fill=factor(gear)) + stat_summary(fun.y=mean, colour="red", geom="point",position=position_dodge(width=0.75))