title: Error (ymax not found) while adding a geom_line (different data) to a multi-layered ggplot
body: <p>I'm trying to generate a plot that summarizes a dataset by first plotting the median &amp; quantiles in an area / black line, after which I want to outline a specific 'firm' with a red line. </p>
  
  <p>I'd also like to do so while facetting on a variable, thus plotting multiple variables at once.</p>
  
  <p>An example code of what I'd plot is as follows:</p>
  
  <pre><code>require(dplyr)
  require(ggplot2)
  
  dt &lt;- structure(list(Firm = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 
      2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 
      4L), .Label = c("a", "b", "c", "d"), class = "factor"), Year = c(2008L, 
      2009L, 2008L, 2009L, 2008L, 2009L, 2008L, 2009L, 2008L, 2009L, 
      2008L, 2009L, 2008L, 2009L, 2008L, 2009L, 2008L, 2009L, 2008L, 
      2009L, 2008L, 2009L, 2008L, 2009L), variable = structure(c(1L, 
      1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 
      3L, 1L, 1L, 2L, 2L, 3L, 3L), .Label = c("var1", "var2", "var3"
      ), class = "factor"), value = c(0.991894223, 2.216322113, 3.189415462, 
      0.663732077, 0.444826423, 2.674568191, 1.272077011, 7.691464914, 
      4.263339855, 0.214415839, 3.995328653, 6.028747322, 8.191459456, 
      0.16205906, 4.056495056, 5.17994524, 0.42435417, 0.678655669, 
      6.246411921, 0.505532339, 4.65045746, 8.85141854, 5.850616048, 
      2.028583225)), .Names = c("Firm", "Year", "variable", "value"
      ), class = "data.frame", row.names = c(NA, -24L))
  
  head(dt)
     Firm Year variable     value
  1     a 2008     var1 0.9918942
  2     a 2009     var1 2.2163221
  3     a 2008     var2 3.1894155
  4     a 2009     var2 0.6637321
  5     a 2008     var3 0.4448264
  6     a 2009     var3 2.6745682
  </code></pre>
  
  <p>I now manually calculate the ymin, ymax, and y for the ribbon / line plots. They're plotting just fine.</p>
  
  <pre><code>dt_aggregates &lt;- dt %&gt;%
    group_by(variable, Year) %&gt;%
    arrange(variable, Year) %&gt;%
    summarize(y=median(value))
  dt_aggregates$ymin &lt;- 0.9*dt_aggregates$y
  dt_aggregates$ymax &lt;- 1.1*dt_aggregates$y
  </code></pre>
  
  <p>This will be the firm I want to highlight:</p>
  
  <pre><code>dt_focus &lt;- filter(dt, Firm=="a")
  </code></pre>
  
  <p>The following plots just fine, and is almost what I want.</p>
  
  <pre><code>g &lt;- ggplot(data=dt_aggregates, 
         aes(x=Year, 
             y=y,
             ymax=ymax,
             ymin=ymin,
             group=variable)) + 
    facet_grid(variable~., scales="free") + geom_line() + geom_ribbon(alpha=0.3) +
    theme_bw() 
  </code></pre>
  
  <p>However, I want to add another line (for the one firm) onto this (in red). 
  Once I try to add a new line with a separate dataframe, I get the following error. Any help on getting this to work is greatly appreciated</p>
  
  <pre><code># Error in eval(expr, envir, enclos) : object 'ymax' not found
  g + geom_line(data=dt_focus, 
              aes(x=Year, y=value, group=variable),
              col="red", size=2)
  </code></pre>