title: plot only a select few facets in facet_grid
body: <p>I was looking for a way to plot using <code>facet_grid</code> in <code>ggplot2</code> that only displays just a few select facets.  say I have the following plot:</p>
  
  <p><img src="https://i.stack.imgur.com/xA6WN.png" alt="enter image description here"></p>
  
  <p>Been looking for a quick way to, for instance, just plot facets 1 and 3.</p>
  
  <pre><code>#data
  y&lt;-1:12
  x&lt;-c(1,2,3,1,2,3,1,2,3,1,2,3)
  z&lt;-c("a","a","a","b","b","b","a","a","a","b","b","b")
  df&lt;-as.data.frame(cbind(x,y,z))
  
  #plot
  
  a &lt;- ggplot(df, aes(x = z, y = y,
    fill = z))
  b &lt;- a + geom_bar(stat = "identity", position = "dodge")
  c &lt;- b + facet_grid(. ~ x, scale = "free_y")
  c
  </code></pre>
  
  <p>Obviously I figured out how to just chop up my data first but this must of course be possible to allocate in <code>ggplot2</code> Even just a nudge would be most welcome.</p>