title: Standard error bars using stat_summary
body: <p>The following code produces bar plots with standard error bars using Hmisc, ddply and ggplot:</p>
  
  <pre><code>means_se &lt;- ddply(mtcars,.(cyl),
                    function(df) smean.sdl(df$qsec,mult=sqrt(length(df$qsec))^-1))
  colnames(means_se) &lt;- c("cyl","mean","lower","upper")
  ggplot(means_se,aes(cyl,mean,ymax=upper,ymin=lower,group=1)) + 
    geom_bar(stat="identity") +  
    geom_errorbar()
  </code></pre>
  
  <p>However, implementing the above using helper functions such as mean_sdl seems much better. For example the following code produces a plot with 95% CI error bars:</p>
  
  <pre><code>ggplot(mtcars, aes(cyl, qsec)) + 
    stat_summary(fun.y = mean, geom = "bar") + 
    stat_summary(fun.data = mean_sdl, geom = "errorbar")
  </code></pre>
  
  <p>My question is how to use the stat_summary implementation for standard error bars. The problem is that to calculate SE you need the number of observations per condition and this must be accessed in mean_sdl's multiplier.</p>
  
  <p>How do I access this information within ggplot? Is there a neat non-hacky solution for this?</p>