[R] Multiple density plots on 1 graph

Kuhn, Max Max.Kuhn at pfizer.com
Wed Sep 21 19:11:15 CEST 2005


Emma,

One way is to use lattice:

test <- data.frame(y = rnorm(5 * 50),
   groupings = rep(letters[1:5], 50))
   
library(lattice)

densityplot( ~ y, group = groupings, data =test)

HTH,

Max
   
   
>emma hartnett emma_hartnett at yahoo.co.uk
>Wed Sep 21 17:57:44 CEST 2005
>
>    * Previous message: [R] Problem with SAGx Library
>    * Next message: [R] factor as seq() in for loop
>    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>
>I want to overlay 50 denisty plots on a single plot. 
>For each plot there are 10,000 data points and i want
>the empirical density of the data. I have not been
>able to find an easy way to achieve this (I have
>scoured the manula and website so sorry if I missed
>it!), does anyone have any suggestions?
>
>Thankyou.


LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}




More information about the R-help mailing list