title: How to add a number of observations per group and use group mean in ggplot2 boxplot?
body: <p>I am doing a basic boxplot  where <code>y=age</code> and <code>x=Patient groups</code> </p>
  
  <pre><code>age &lt;- ggplot(data, aes(factor(group2), age))  + ylim(15, 80) 
  age + geom_boxplot(fill = "grey80", colour = "#3366FF")
  </code></pre>
  
  <p>I was hoping you could help me out with a few things:</p>
  
  <p>1) Is it possible to include a number of observations per group above each group boxplot (but NOT on the X axis where my group labels are) without having to do this in paint :)? 
   I have tried using:</p>
  
  <pre><code>age + annotate("text", x = "CON", y = 60, label = "25")
  </code></pre>
  
  <p>where <code>CON</code> is the 1st group and <code>y = 60</code> is ~ just above the boxplot for this group. However, the command didn't work. I assume it has something to do that it reads <code>x</code> as a continuous rather than a categorical variable. </p>
  
  <p>2) Also although there are plenty of questions about using the mean rather than the median for the boxplots, I still haven`t found a code that works for me? </p>
  
  <p>3) On the same matter is there a way you could include the mean group stat in the boxplot? Perhaps using</p>
  
  <pre><code>age + stat_summary(fun.y=mean, colour="red", geom="point")
  </code></pre>
  
  <p>which however only includes a dot of where the mean lies. Or again using</p>
  
  <pre><code>age + annotate("text", x = "CON", y = 30, label = "30")
  </code></pre>
  
  <p>where <code>CON</code> is the 1st group and <code>y = 30</code> is ~ the group age mean. 
  Knowing how flexible and rich <code>ggplot2</code> syntax is I was hoping that there is a more elegant way of using the real stats output rather than <code>annotate</code>.</p>
  
  <p>Any suggestions/links would be much appreciated! </p>
  
  <p>Thanks!!</p>