title: Plot mean in an R plot
body: <p>I would like to add a mean of valuus to windows in a scatter plot I have. I created the scatter plot with ggplot2 </p>
  
  <pre><code> p &lt;- ggplot(mtcars, aes(wt, mpg)) 
  p + geom_point()
  </code></pre>
  
  <p>This will give the scatter plot but I woudl like to add add the mean of a window (say size equals 1) and plot this points of the mean as a line. Additionally I woudl like to have vertical bars at each point to indicate the variance. </p>
  
  <p>Mtcars is the data set standard available in ggplot 2</p>