I have split a data set into two different data frames.
I want to use both data frames making a 2 panel plot using lattice. I need to know if this is possible?
Or do I have to keep 1 data frame and create a factor variable?
I have split a data set into two different data frames.
I want to use both data frames making a 2 panel plot using lattice. I need to know if this is possible?
Or do I have to keep 1 data frame and create a factor variable?
Generally speaking, Lattice likes everything to be in one data.frame. Lattice includes the make.groups(...)
function to make this process easier. For example:
d1<-data.frame(x=runif(20), y=rnorm(20))
d2<-data.frame(x=runif(20,.5,1.5),y= rnorm(20, 0, 2))
xyplot(y~x, make.groups(d1=d1, d2=d2), groups=which, auto.key=T)