[R] Stacked density plots

Deepayan Sarkar deepayan.sarkar at gmail.com
Sat Apr 11 01:01:54 CEST 2009


On Fri, Apr 10, 2009 at 1:53 PM, Judith Flores <juryef at yahoo.com> wrote:
>
> Hello R-community,
>
>    I want to generate stacked density plots in lattice. My data consist of a numeric variable ('pid') that is measured in different individuals ('id'), which can be divided in two types ('type') and the measurements were repeated a different time points ('day').
>
> I read in the Lattice book that this can be done using the 'flowViz' package, so I tried to reproduce the example given in there and obtained an error:
>
> library('flowViz')
> data(GvHD, package='flowCore")
> densityplot(Visit~'FSC-H'|Patient, data=GvHD)
>
> Error: ' "FSC-H" ' is/are no valid parameter(s) in this frame
>
>    I am not sure if I am missing something. I was hoping to apply something similar to my data, maybe like this?
>
> desityplot(id~pid|type+day, data=mydata)

Try:

demo("panel", package = "lattice")
file.show(system.file("demo/panel.R", package = "lattice"))

-Deepayan




More information about the R-help mailing list