title: Adding a shaded rectangle to an existing plot using geom_rect
body: <p>I am having a hard time adding a series of shaded rectangles on top of an existing ggplot. Thanks in advance for your help. </p>
  
  <p>I started by making a time series line graph using geom_line. I used the dataframe "unemp_table", and plotted "Month" on the X, and "NYC.Employment" on the Y. </p>
  
  <p>unemp_table looks like this:</p>
  
  <pre><code>   Month        Sample        NYC.Employment     
    (date)        (int)           (int)                                           
   1976-01-01      1              2771                            
   1976-02-01      2              2770                                       
   1976-03-01      3              2769                                           
   1976-04-01      4              2768                                         
  </code></pre>
  
  <p>My ggplot code (which works) looks like this:</p>
  
  <pre><code>unemp_graph &lt;- ggplot(data=unemp_table, aes(x=Month,y=NYC.Employment)) 
  +geom_line()
  </code></pre>
  
  <p>Next, I want to plot some shaded recession bars.  </p>
  
  <p>I started by loading a different data frame (Reces_table) with the start and end of each relevant recession. </p>
  
  <p>Reces_table looks like this:</p>
  
  <pre><code>  Start        End
    (date)     (date)
  1 1980-01-01 1980-07-01
  2 1981-07-01 1982-11-01
  3 1990-07-01 1991-03-01
  4 2001-03-01 2001-11-01
  5 2007-12-01 2009-06-01
  </code></pre>
  
  <p>But, when I try and plot these points as shaded rectangles, I get errors. </p>
  
  <p>This code:</p>
  
  <pre><code>unemp_graph + geom_rect(Reces_table, aes(xmin=Start, xmax=End, 
  ymin=-Inf, ymax=+Inf), fill='pink', alpha=0.2)
  </code></pre>
  
  <p>Gives me this error:</p>
  
  <pre><code>Error: ggplot2 doesn't know how to deal with data of class uneval
  </code></pre>
  
  <p>I read in a different thread that I need to add "data=" into the geom_rect function.  However, the updated code:</p>
  
  <pre><code>unemp_graph + geom_rect(data=Reces_table, 
  aes(xmin=Start, xmax=End, ymin=-Inf, ymax=+Inf), fill='pink', alpha=0.2)
  </code></pre>
  
  <p>Gives me this error:</p>
  
  <pre><code>Error in eval(expr, envir, enclos) : object 'Month' not found
  </code></pre>
  
  <p>Any tips would be appreciated, thanks in advance for your help!</p>