title: Why does facet_grid work, but not facet_wrap?
body: <p>I would like to use faceting, but also to control the number of rows and columns. So facet_wrap is preferred to facet_grid. But while facet_grid works, facet_wrap does not and gives an error: "At least one layer must contain all variables used for facetting". Why does this occur? How can I use facet_wrap here? </p>
  
  <pre><code>x &lt;- rnorm(8)
  y &lt;- x + rnorm(8, sd=0.7)
  dd &lt;- data.frame(id=rep(1:4, 2), x=x, y=y)
  pp &lt;- ggplot(dd, aes(x, y)) + geom_point()
  pp  
  pp + facet_grid(. ~ id)  # works
  pp + facet_wrap(. ~ id)  # error
  </code></pre>