Skip to content
Prev 366212 / 398502 Next

Is it possible to create such graph - Which packages can come handy?

It's certainly possible, and you don't need any packages to do it; you can do it all in base R.

You can use the findInterval() function to identify which points are in which ranges. Here's an example:
[1] 20 22 24 26 28 30
[1] 4 5 4 5 2 2 2 5 2 1 1 3 4 1 1 5

Then within each interval calculate the mean and standard deviation, use those as input to the dnorm() function to calculate the bell curves. It'll take some tweaking to deal with the fact that you want the bell curves oriented vertically. The smoothing curve can be created with the supsmu() function, among others. There are various details that could make the whole thing tricky to get exactly as you want it. But it's certainly possible.

-Don