0

I want to plot each mean of the factor(MAP) on each Size(x-axis), can anybody help me?

qplot(Size,Rc,data=rc.data, geom="boxplot") + 
  geom_point(aes(color=factor(MAP)))
scl
  • 3
  • 3
  • 2
    Possible duplicate of [Joining means on a boxplot with a line (ggplot2)](http://stackoverflow.com/questions/3989987/joining-means-on-a-boxplot-with-a-line-ggplot2) –  Jan 04 '16 at 05:27

1 Answers1

0

Use stat_summary to calculate and plot the means:

qplot(Size,Rc,data=rc.data, geom="boxplot") + 
  geom_point(aes(color=factor(MAP))) +
  stat_summary(fun.y=mean, geom="line", aes(colour=factor(MAP), group=factor(MAP))) +
  stat_summary(fun.y=mean, geom="point", aes(colour=factor(MAP), pch=3, size=3)
eipi10
  • 91,525
  • 24
  • 209
  • 285