title: Displaying values from a character vector as italic labels in boxplot in R
body: <p>I want to use a character vector for boxplot names, how can I get these to be displayed as italic?</p>
  
  <pre><code># get some data
  x &lt;- rnorm(1000)
  
  # I want to get this:
  labels &lt;- c(expression(italic("One"), italic("Two")))
  labels
  
  boxplot(split(x, cut(x,breaks = c(-Inf, 0, Inf))), names = labels)
  </code></pre>
  
  <p>But using a character vector, such as </p>
  
  <pre><code>sNames &lt;- c("One", "Two")
  </code></pre>
  
  <p>I've tried <code>bquote()</code>, <code>expression()</code> ...</p>
  
  <pre><code>labels &lt;- bquote(expression(italic(.(sNames))))
  labels # but this is length 1, not 2
  </code></pre>
  
  <p>... and with <code>sapply()</code></p>
  
  <pre><code>labels &lt;- sapply(sNames, function(x) bquote(expression(italic(.(x)))))
  labels
  
  boxplot(split(x, cut(x,breaks = c(-Inf, 0, Inf))), names = labels)
  </code></pre>
  
  <p>but this doesn't seem to be interpreted as an expression.</p>
  
  <p>Thanks for any help.</p>