Adding expressions to facet labeller in ggplot 2 2.0
<p>I need to replace one facet wrap label with a complicated expression. However, i cannot get the function <a href="https://stackoverflow.com/questions/11979017/changing-facet-label-to-math-formula-in-ggplot2">facet_wrap_labeller</a> to work anymore with plots created under older ggplot2 versions.</p>

<pre><code>        data &lt;- as.data.frame(matrix(rnorm(60),20,3)) 
        data$factor &lt;- c(rep("f1", 4),rep("f2", 4), rep("f3", 4), rep("f4",4),rep("f5", 4))
        names(data) &lt;- c("A", "B", "C", "factor")
        melted &lt;- melt(data)

        p &lt;- ggplot(melted, aes(variable, value)) +
             stat_boxplot(geom ='errorbar') + 
             geom_boxplot()
        p1 &lt;- p + facet_wrap(~factor)
        facet_wrap_labeller(p1, labels=c("A", "B", expression({}^2*italic(D)~textstyle(group("(", rarefied, ")")))))
</code></pre>

<p>and i get:</p>

<pre><code>Error in getGrob(gg[[strips[ii]]], "strip.text", grep = TRUE, global = TRUE) : 
  it is only valid to get a child from a "gTree"
Called from: getGrob(gg[[strips[ii]]], "strip.text", grep = TRUE, global = TRUE)
</code></pre>

<p>I believe this is happening because of ggplot2 2.0 not being compatible to this function.</p>

<p>I also tried the <code>labeller=labeller()</code>, and <code>labeller=bquote()</code> arguments, but when i tried to use this vector</p>

<pre><code>newlabels &lt;- c(A="A", B="B",,
    D=expression({}^0*italic(D)~textstyle(group("(", rarefied, ")"))))
</code></pre>

<p>in </p>

<pre><code>p1 &lt;- p + facet_wrap(~factor, 
           labeller = labeller(factor=newlabels))
</code></pre>

<p>the expression is ignored and the original factor levels are plotted. With bquote, i dont know to add more than one name to the argument.</p>

<p>Any help is appreciated.</p>