title: bquote: How to include an expression saved as a string object?
body: <p>My goal is to annotate a plot with the slope of a best-fit line and label the units of the slope, where the label is saved as a separate string object. I'm having trouble figuring out how to get <code>bquote()</code> to convert a string object into an expression, and combine it with other evaluated statements.</p>
  
  <p>A demonstration:</p>
  
  <pre><code># example data:
  x &lt;- c(1:20)                   # x units: time
  y &lt;-  x * rnorm(20, 10, 2)     # y units: length per time
  
  unit.label &lt;- "L%.%T^-2"       # label for slope of best fit line 
  lm1 &lt;- summary(lm(y ~ x))
  
  plot(y ~ x)
  </code></pre>
  
  <p>The problem occurs when I try to annotate the plot. I can get bquote() to display the slope:</p>
  
  <pre><code>text(median(x), min(y), bquote(slope: .(round(lm1$coefficients[2], 2))) )
  </code></pre>
  
  <p>I can also get <code>bquote()</code> to show the slope's units:</p>
  
  <pre><code>plot(y ~ x)
  text(median(x), min(y), bquote(.(parse(text = unit.label))) )
  </code></pre>
  
  <p>But I'm unable to combine the label and the slope into a single <code>bquote()</code> statement:</p>
  
  <pre><code>plot(y ~ x)
  text(median(x), min(y), bquote(slope: .(round(lm1$coefficients[2], 2)) 
  .(parse(text = unit.label))) ) 
  # Error: unexpected symbol in "text(median(x), min(y), bquote(slope: 
  # .(round(lm1$coefficients[2], 2)) ."
  </code></pre>
  
  <p>Using <code>paste()</code>, the unit label appears along with the slope, but the label isn't read as an expression:</p>
  
  <pre><code>plot(y ~ x)
  text(median(x), min(y), bquote(slope: .(paste(round(lm1$coefficients[2], 2), 
  as.expression(unit.label))))
  )
  </code></pre>
  
  <p>Where am I going wrong? Is it a simple syntax problem in my bquote command?
  Thanks for any suggestions!</p>