[R] layout is to xyplot as ??? is to qplot

Jim Price price_ja at hotmail.com
Thu Jul 10 22:28:02 CEST 2008


Playing with ggplot, something I'd promised myself I'd get around to. I've
the following scenario:

library(lattice)
library(ggplot2)

myData <- data.frame(
	x = rnorm(100),
	y = rnorm(100),
	group = 1:4
)

xyplot(y ~ x | factor(group), data = myData, layout = c(2, 2))

qplot(x, y, facets = ~ group, data = myData) 



In this code the lattice example gives me a 2x2 layout, whereas the ggplot
example gives me a 1x4 layout, as per the facets specification. Can I mimic
the effect of the layout parameter in xyplot inside qplot? Apologies if I've
missed an obvious help-page somewhere!

Thanks in advance,
Jim Price
Cardiome Pharma Corp.


-- 
View this message in context: http://www.nabble.com/layout-is-to-xyplot-as-----is-to-qplot-tp18391206p18391206.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list