> the example below does not work. (i know it's not supposed, but it makes it > clear what i'm trying to achieve) > > par(mfrow=c(2,1)) > xyplot(y~x2|x1,data=dataframe1,pch=20) > xyplot(y~x2|x1,data=dataframe2,pch=20) > > i know i could probably merge the two datasets and do something like > xyplot(y~x2|x1+dataset,data=merged)
par is a base graphics command, and doesn't work with grid/lattice graphics. While it is possible to merge grid and base graphics using for example the gridBase package, I suspect what you want is to draw two lattice plots on the same figure. For this, you need to read up on viewports, and try an example like this: pushViewport(viewport(layout=grid.layout(2,1))) pushViewport(viewport(layout.pos.row=1)) topplot = xyplot(Sepal.Length ~ Petal.Length | Species, data = iris) print(topplot, newpage=FALSE) upViewport() pushViewport(viewport(layout.pos.row=2)) bottomplot = xyplot(Sepal.Width ~ Petal.Width | Species, data = iris) print(bottomplot, newpage=FALSE) popViewport(2) See also section 5.5 in Paul Murrell's book ('R Graphics'). Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} ______________________________________________ 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.