This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to draw the figure as the below using R ?

Hi

How to draw the figure as the below using R?

Thank you very much.

enter link description here

r

1 answer

The plot looks like multiple histograms or density curves. Here are the possible codes in R to achieve this,

http://stackoverflow.com/questions/3541713/how-to-plot-two-histograms-together-in-r

it is density curves, and he shall use ggplot geom_density() function where you will have R dataframe

ggplot(yourdataFrame, aes(yourTrait, fill = variable_to_distinguish_betweentrait, colour = variable_to_distinguish_betweentrait)) +geom_density(alpha = 0.5)

good example can be found here https://www.r-bloggers.com/density-plot-with-ggplot/

I guess, the link I provided has an example with ggplot geom_density().

Log in to answer this question.