title: ggplot2: Cannot color area between intersecting lines using geom_ribbon
body: <p>I'm working with data from all 50 states. I'm trying to chart small multiple line charts with one line being the state (blue) and the other as the national average (gray). </p>
  
  <p>Here is an example for Maine:</p>
  
  <p><a href="https://i.stack.imgur.com/nah0d.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nah0d.png" alt="enter image description here"></a></p>
  
  <p>Here is what my data frame for Maine looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/jJrbV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jJrbV.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to shade the areas where the state line falls below the national average red and when it is above it green. </p>
  
  <p>I've used <code>geom_ribbon</code> to shade the area and get one color (scale is different):
  <a href="https://i.stack.imgur.com/dZ3cD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dZ3cD.png" alt="enter image description here"></a></p>
  
  <p>However, I'm struggling to find a way to change the fill when the state line crosses the national line. </p>
  
  <p>When I run this code:</p>
  
  <pre><code>ggplot(states, aes(x = year, group=1)) + 
    geom_line(aes(y = ttc_avg),colour='#006f91') +
    geom_line(aes(y = nat_avg), colour='#666666') +
    geom_ribbon(aes(x=year, ymin = nat_avg, ymax = ttc_avg, fill=ttc_avg &gt; nat_avg)) +
    scale_fill_manual(values=c("green", "red"), name="fill") +
    facet_wrap(~state)
  </code></pre>
  
  <p>I get an error that says <code>Aesthetics can not vary with a ribbon.</code></p>
  
  <p>What is the best way to tackle this? Should I be using <code>geom_ribbon</code> or another ggplot2 function?</p>