title: Superimpose a normal distribution to a density using ggplot in R
body: <p>I am trying to superimpose a normal distribution to a density using ggplot in R:</p>
  
  <pre><code>ggplot(Data, aes(x=Rel, y=..density..)) +
      geom_density(aes(fill=factor(cut)), position="stack") +
      stat_function(fun = dnorm, args = list(mean = Rel.mean, sd = Rel.sd))
  </code></pre>
  
  <p>But I keep getting this error:</p>
  
  <pre><code>Error in eval(expr, envir, enclos) : object 'density' not found
  Calls: print ... &lt;Anonymous&gt; -&gt; as.data.frame -&gt; lapply -&gt; FUN -&gt; eval
  </code></pre>
  
  <p>Why? Any solution?</p>