title: combining legend and paste command in base R plot
body: <p>I want to <code>paste()</code> some text into the legend in my plot, but I cannot get R to correctly read the <code>c()</code> and <code>paste()</code> commands.</p>
  
  <pre><code>plot(1:10,1:10,type="n")
  
  a &lt;- 23
  b &lt;- 32
  
  legend("topleft",inset=0.05,
         legend=c("1-15: n=[23]\nEstimated","15+: n=[32]\nAveraged"),
         lty=c(1,1),col=c("black","red"),bty="n",cex=1.5)
  
  legend("topright",inset=0.05,
         legend=c(paste("1-15: n=[",a,"]\nEstimated","15+: n=[32]\nAveraged")),
         lty=c(1,1),col=c("black","red"),bty="n",cex=1.5)
  </code></pre>
  
  <p>so the legend on the left is manually created, my desired output is to create the same on the right hand side.</p>