title: ggplot2: using the geom_area() function
body: <p>I have a data frame showing four classes for each year, along with their respective shares of the total for that year. </p>
  
  <pre><code>&gt; head(df)
        class year share
  1    class1 1975 0.806
  2    class2 1975 0.131
  3    class3 1975 0.018
  4    class4 1975 0.045
  5    class1 1976 0.788
  6    class2 1976 0.151
  </code></pre>
  
  <p>When I run <code>ggplot</code> with no <code>fill</code> specified, I get a uniform gray box, as expected.</p>
  
  <pre><code>&gt; ggplot(df, aes(x=year, y=share, group=class)) + geom_area() + scale_fill_brewer()
  </code></pre>
  
  <p>So I try to add <code>fill=class</code>, and it doesn't work.</p>
  
  <pre><code>&gt; ggplot(df, aes(x=year, y=share, group=class, fill=class)) + geom_area() + scale_fill_brewer()
  
  Error in inherits(x, "factor") : object "base_size" not found
  In addition: Warning message:
  In inherits(x, "factor") : restarting interrupted promise evaluation
  &gt; 
  </code></pre>
  
  <p>What can I do to the <code>class</code> factor to get it working properly with <code>scale_fill_brewer()</code>? The idea, obviously, is to shade each area of the graph according to its class.</p>
  
  <p>Thanks.</p>