title: How to plot a density estimate on top of the histogram?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1497539/fitting-a-density-curve-to-a-histogram-in-r">Fitting a density curve to a histogram in R</a>  </p>
  </blockquote>
  
  
  
  <p><code>x</code> is a NAs free numeric vector.</p>
  
  <p>I run:</p>
  
  <pre><code>&gt; hist(x,density(x), prob=TRUE)
  
  Error Message I get:
  Error in rank(x, ties.method = "min", na.last = "keep") : 
    unimplemented type 'list' in 'greater'
  </code></pre>
  
  <p>It was suggested that I set prob =TRUE when calling hist. If you can explain that as well, it will be great. Thank you.</p>