
Richard S. answered 08/14/23
Professor and Industry Scientist: Psychology and Statistics [R, SPSS]
For purposes of data re-usability, we can set your data example as a data frame:
Then we will need to draw the histogram, BUT, we will need to set the y-scale as a function of the probability density with the addition of "prob = TRUE". This is necessary because density functions are the likelihood of a data point being observed, and not the data itself.
Now, we can add the density of the histogram with the "lines" function which writes on top of any prior base-r graphic.
In all, your code would look like: