title: Add an average line to an existing plot
body: <p>I want to add an average line to the existing plot.</p>
  <pre><code>library(ggplot2)
  
  A &lt;- c(1:10)
  B &lt;- c(1,1,2,2,3,3,4,4,5,5)
  
  donnees &lt;- data.frame(A,B) 
  datetime&lt;-donnees[,2]
  Indcatotvalue&lt;-donnees[,1]
  df&lt;-donnees
  
  mn&lt;-tapply(donnees[,1],donnees[,2],mean)
  moyenne &lt;- data.frame(template=names(mn),mean=mn)
  
  ggplot(data=df,
     aes_q(x=datetime,
           y=Indcatotvalue)) + geom_line() 
  </code></pre>
  <p>I have tried to add :</p>
  <pre><code>geom_line(aes(y = moyenne[,2], colour = &quot;blue&quot;))
  </code></pre>
  <p>or :</p>
  <pre><code>lines(moyenne[,1],moyenne[,2],col=&quot;blue&quot;)
  </code></pre>
  <p>but nothing happens, I don't understand especially for the function &quot;lines&quot;.</p>