Hello,

I am try to make a density plot where plots are stacked like the one
found here:

http://dsarkar.fhcrc.org/lattice/book/images/Figure_14_03_stdBW.png

I am facing problems, however. Using the code example below, I'd like
to generate a separate panel for each val of id2. Within each panel,
I'd like to have individual histograms each on separate lines based on
the value of id1.  Note that the code example works fine if I use
"boxplot" instead of "densityplot". Any pointers would be much
appreciated.


library(lattice)
val<-rep(rnorm(10),100)
id1<-sample(c(1:5), 100, replace = TRUE)
id2<-rep(c(6:10),100, replace = TRUE)
a_df<-data.frame(cbind(id1, id2, val))
densityplot(factor(id1) ~ val | factor(id2), data=a_df)

-Manish

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to