How to overlay density plots in R?
I would like to overlay 2 density plots on the same device with R. How can I do that? I searched the web but I didnt find any obvious solution (I am rather new to R). My idea would be to read data from a text file (columns) and then use plot(density(MyData$Column1)) plot(density(MyData$Column2), add=T) well something in this spirit... Thanks in advance cbeleites use lines for the second one: plot(density(MyData$Column1)) lines(density(MyData$Column2)) make sure the limits of the first plot are suitable, though. ggplot2 is another graphics package that handles things like the range issue Gavin