title: ggplot geom_rect() error "object not found"
body: <p>I'm trying to plot a <code>geom_rect()</code>. Why do I receive an <code>Error in FUN(X[[i]], ...) : object 'Month' not found</code>? If I run <code>df$Month</code> in my console the object is there:</p>
  
  <pre><code>df$Month
  #&gt; [1] 2019-01 2019-02 2019-03
  #&gt; Levels: 2019-01 2019-02 2019-03
  </code></pre>
  
  <p>Here's my code block:</p>
  
  <pre><code>library(tidyverse)
  df &lt;- tibble(Month = factor(c("2019-01", "2019-02", "2019-03")), 
               Value = c(4, 9, 7))
  
  ggplot(df, aes(Month, Value, group = 1)) + 
    geom_line() + 
    theme_minimal() + 
    geom_rect(data = 
                data.frame(xmin = min(as.integer(df$Month)) - 0.5,
                           xmax = max(as.integer(df$Month)) + 0.5,
                           ymin = min(df$Value),
                           ymax = max(df$Value)),
              aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
              alpha = 0.2, fill = "green")
  
  #&gt; Error in FUN(X[[i]], ...) : object 'Month' not found
  </code></pre>