title: How can I remove empty factors from ggplot2 facets?
body: <p>I'm trying to modify an <a href="http://statbandit.wordpress.com/2010/11/01/forest-plots-using-r-and-ggplot2/">example of a simple forest</a> plot by introducing facets according to a  factor variable.</p>
  
  <p>Assuming data of this structure:</p>
  
  <pre><code>test &lt;- structure(list(characteristic = structure(c(1L, 2L, 3L, 1L, 2L
  ), .Label = c("Factor1", "Factor2", "Factor3"), class = "factor"), 
      es = c(1.2, 1.4, 1.6, 1.3, 1.5), ci_low = c(1.1, 1.3, 1.5, 
      1.2, 1.4), ci_upp = c(1.3, 1.5, 1.7, 1.4, 1.6), label = structure(c(1L, 
      3L, 5L, 2L, 4L), .Label = c("1.2 (1.1, 1.3)", "1.3 (1.2, 1.4)", 
      "1.4 (1.3, 1.5)", "1.5 (1.4, 1.6)", "1.6 (1.5, 1.7)"), class = "factor"), 
      set = structure(c(1L, 1L, 1L, 2L, 2L), .Label = c("H", "S"
      ), class = "factor")), .Names = c("characteristic", "es", 
  "ci_low", "ci_upp", "label", "set"), class = "data.frame", row.names = c(NA, 
  -5L))
  </code></pre>
  
  <p>And running the code:</p>
  
  <pre><code>p &lt;- ggplot(test, aes(x=characteristic, y=es, ymin=ci_low, ymax=ci_upp)) + geom_pointrange() +
    coord_flip() + geom_hline(aes(x=0), lty=2) + 
    facet_wrap(~ set, ncol = 1) +
    theme_bw() + 
    opts(strip.text.x = theme_text())
  </code></pre>
  
  <p>Produces output like that:</p>
  
  <p><img src="https://i.stack.imgur.com/ySsXY.png" alt="enter image description here"></p>
  
  <p>All good so far. However, I'd like to get rid of empty Factor3 level from my lower panel and cannot find a way to do that. Is there any way to do that?</p>
  
  <p>Thanks for help.</p>