I have data with continuous frequency and a continuous support which I'd like to analyze and plot using a kernel density estimate in R. I can create the basic plot in JMP fairly easily using the Distribution platform making using of the Freq option as shown below. It generates a histogram from which I can quickly overlap a density estimate.
What's the equivalent of this
Freq option in R?
Read on if you are interested in why I'm trying to do this. I am aiming to add vertical lines at the specific local maximums in the density, and that isn't so easy to do with JMP in an automated fashion. Plus, I'd like to improve my R knowledge. Below is a plot that very roughly captures what I'm trying to get to with this data. The curve is a kernel density estimate. I don't care about the shadowgram, but I couldn't get JMP to make the plot without either a histogram or a shadowgram visible. I couldn't find any tutorials showing how to do anything like this in R. Could you point me in the right direction?
Here is the data set I used to make the plot above.
x y 0 0.5314379598 0.1 1.3521410475 0.2 0.0449186138 0.3 0.4225592288 0.4 0.0496982985 0.5 1.1107962989 0.6 0.2438757387 0.7 0.7023629225 0.8 1.7466573415 0.9 0.7134595708 1 1.1313968897 1.1 0.6055951286 1.2 0.2924553991 1.3 0.2913429266 1.4 0.3221193803 1.5 0.4683161595 1.6 0.682958405 1.7 0.1082714352 1.8 0.0489443405 1.9 0.3309649262