title: Using superscript when changing labels in facet_wrap()
body: <p>I am using facet_wrap() to plot 7 air quality pollutants on 1 page.  I want to rename the individual plot labels from the abbreviation used in my dataframe (ex. &quot;PM&quot;) to the long form (ex. &quot;Fine Particulate Matter (ug/m3)&quot;) and want to include a superscript in one of the labels (ug/m^3). I can't find a way to integrate the superscript when changing the labels.</p>
  <p>My code without the superscripts works fine:</p>
  <pre><code>&gt; SeasonalMean
      Pollutant Season       mean        cv
   1:       SO2 Winter  4.3594786 1.2606103
   2:        NO Winter  4.8086810 1.3138420
   3:       NO2 Winter 13.4610992 0.4983027
   4:       NOX Winter 18.2377363 0.6503697
   5:        CO Winter  0.2578629 0.3373904
   6:        O3 Winter 25.0978910 0.4094255
   7:        PM Winter  9.4271302 0.5599974
   8:       NOX Spring 14.1144831 0.6320194
   9:        CO Spring  0.2198282 0.2964914
  10:        O3 Spring 26.2944466 0.3021818
  11:        PM Spring  7.7559475 0.5107155
  12:       SO2 Spring  2.7709979 1.5018185
  13:        NO Spring  3.3221394 1.4227275
  14:       NO2 Spring 10.7621779 0.4771676
  15:        CO Summer  0.2332291 0.3337901
  16:        O3 Summer 25.8531689 0.3426781
  17:        PM Summer  8.5609107 0.5751629
  18:       SO2 Summer  3.2485138 1.3612882
  19:        NO Summer  4.3011274 1.6905351
  20:       NO2 Summer 11.4917325 0.4739557
  21:       NOX Summer 15.8515746 0.7333461
  22:        O3   Fall 25.3569794 0.3529466
  23:        PM   Fall  8.0808294 0.5460776
  24:       SO2   Fall  3.7543985 1.3780758
  25:        NO   Fall  3.1074317 1.1202237
  26:       NO2   Fall 11.8911633 0.4549728
  27:       NOX   Fall 15.0387167 0.5627663
  28:        CO   Fall  0.2378491 0.2780384
  
  new_labels &lt;- c(&quot;CO&quot; = &quot;Carbon Monoxide (ppb)&quot;, &quot;NO&quot; = &quot;Nitric Oxide (ppb)&quot;, &quot;NO2&quot; = &quot;Nitrogen Dioxide (ppb)&quot;, &quot;NOX&quot; = &quot;Nitrogen Oxides (ppb)&quot;, &quot;O3&quot; = &quot;Ground-Level Ozone (ppb)&quot;, &quot;SO2&quot; = &quot;Sulphur Dioxide (ppb)&quot;, &quot;PM&quot; = &quot;Fine Particulate Matter (ug/m^3)&quot;)
  
  p1 &lt;- ggplot(SeasonalMean, aes(x = Season, y = mean)) +
    facet_wrap(~ Pollutant, scales = &quot;free&quot;, labeller = labeller(Pollutant = new_labels)) +
    geom_point() +
    labs(title = &quot;Average Seasonal Air Pollutant Concentrations in Hamilton Downtown (2017)&quot;, x = &quot;Season&quot;, y = &quot;Mean&quot;) +
    theme(axis.text.x = element_text(angle = 90, vjust=0.5), plot.title = element_text(hjust = 0.5))
  </code></pre>
  <p>I looked at some other questions but couldnt find any that combined changing facet labels while also using superscript: <a href="https://stackoverflow.com/questions/18965319/how-do-i-include-a-superscript-to-texts-on-a-plot-on-r">How do I include a superscript to texts on a plot on R?</a>, <a href="https://stackoverflow.com/questions/20980761/superscript-in-r">Superscript in R</a>, <a href="https://stackoverflow.com/questions/10156417/subscripts-in-plots-in-r">Subscripts in plots in R</a>, <a href="https://stackoverflow.com/questions/3472980/how-to-change-facet-labels">How to change facet labels?</a></p>
  <p>My attempts have included using expression() and bquote() when making the list of label names:</p>
  <pre><code>new_labels &lt;- c(&quot;CO&quot; = &quot;Carbon Monoxide (ppb)&quot;, &quot;NO&quot; = &quot;Nitric Oxide (ppb)&quot;, &quot;NO2&quot; = &quot;Nitrogen Dioxide (ppb)&quot;, &quot;NOX&quot; = &quot;Nitrogen Oxides (ppb)&quot;, &quot;O3&quot; = &quot;Ground-Level Ozone (ppb)&quot;, &quot;SO2&quot; = &quot;Sulphur Dioxide (ppb)&quot;, &quot;PM&quot; = expression(&quot;Fine Particulate Matter (ug/m^3)&quot;))
  </code></pre>
  <p>but this just makes the whole list an expression:</p>
  <pre><code>&gt; new_labels
  expression(CO = &quot;Carbon Monoxide (ppb)&quot;, NO = &quot;Nitric Oxide (ppb)&quot;, 
      NO2 = &quot;Nitrogen Dioxide (ppb)&quot;, NOX = &quot;Nitrogen Oxides (ppb)&quot;, 
      O3 = &quot;Ground-Level Ozone (ppb)&quot;, SO2 = &quot;Sulphur Dioxide (ppb)&quot;, 
      PM = &quot;Fine Particulate Matter (ug/m^3)&quot;)
  </code></pre>
  <p>and I also tried using expression() and bquote() within the labeller() parameter of facet_wrap(), but this results in none of the plot labels changing:</p>
  <pre><code>p1 &lt;- ggplot(SeasonalMean, aes(x = Season, y = mean)) +
    facet_wrap(~ Pollutant, scales = &quot;free&quot;, labeller = labeller(Pollutant = expression(new_labels))) +
    geom_point() +
    labs(title = &quot;Average Seasonal Air Pollutant Concentrations in Hamilton Downtown (2017)&quot;, x = &quot;Season&quot;, y = &quot;Mean&quot;) +
    theme(axis.text.x = element_text(angle = 90, vjust=0.5), plot.title = element_text(hjust = 0.5))
  </code></pre>
  <p>Sorry I'm not able to include any pictures of the plots, thanks in advance!</p>