title: geom_rect on some panels of a facet_wrap
body: <p>I am trying to get a shaded rectangle on the first three panels in my <code>facet_wrap</code> plot. However, when I use <code>geom_rect</code> for the job, it produces the rectangle on each of the panels. Is there a way to selectively get the rectangle only on the first three panels?</p>
  
  <p>Here is some code</p>
  
  <pre><code>dfTemp = data.frame(value = rnorm(100*4), variable = sort(rep(1:4, 100)),
                      date = rep(seq.Date(
                        from = as.Date('2011-01-01', format = '%Y-%m-%d'),
                        length.out = 100,
                        by = 'day'), 4))
  
  ggplot(dfTemp) +
    geom_rect(aes(xmin = as.Date('2011-02-01', format = '%Y-%m-%d'),
                  xmax = as.Date('2011-03-01', format = '%Y-%m-%d'),
                  ymin = -Inf,
                  ymax = Inf), alpha = 0.2, fill = 'grey') +
    geom_line(aes(x = date, y = value, group = variable, color = factor(variable))) +
    facet_wrap(~variable , scale = 'free', ncol = 1) 
  </code></pre>
  
  <h2>Update 1:</h2>
  
  <p>I updated my code to </p>
  
  <pre><code>dfTemp = data.frame(value = rnorm(100*4), variable = sort(rep(1:4, 100)),
                      date = rep(seq.Date(
                        from = as.Date('2011-01-01', format = '%Y-%m-%d'),
                        length.out = 100,
                        by = 'day'), 4))
  
  ggplot(dfTemp) +
    geom_rect(data = dfTemp[dfTemp$variable %in% c(2, 3),],
              aes(xmin = as.Date('2011-02-01', format = '%Y-%m-%d'),
                  xmax = as.Date('2011-03-01', format = '%Y-%m-%d'),
                  ymin = -Inf,
                  ymax = Inf), alpha = 0.2, fill = 'grey') +
    geom_line(aes(x = date, y = value, group = variable, color = factor(variable))) +
    facet_wrap(~variable , scale = 'free', ncol = 1) 
  </code></pre>
  
  <p>Note that I am now subsetting the data that I am passing to <code>geom_rect</code>. But this gives me this warning:</p>
  
  <blockquote>
    <p>Warning message: In <code>[&lt;-.factor</code>(<code>*tmp*</code>, rng, value = c(1L, 1L, 1L,
    1L, 1L, 1L,  :   invalid factor level, NA generated</p>
  </blockquote>
  
  <p>What does this mean?</p>