Does anyone (Hadley??) know if there's a straightforward way in ggplot2 to get data divided by a single factor to plot as a rectangular grid of subplots? So far I've only been able to get such data plotted as a single row or single column of skinny subplots. The code below gives an example implemented with lattice, and my best attempt in ggplot2
cheers Ben Bolker ------------ g= rep(1:9,each=50) means = rnorm(9) vars = runif(9) x = rnorm(450,means[g],vars[g]) TDBU = data.frame(system=factor(g),x) require(lattice) histogram( ~ x | system, data = TDBU, xlab = "LRR Effect Size",type="density", panel = function(x, ...) { panel.histogram(x, ...) panel.densityplot(x,...) } ) library(ggplot2) ggplot(TDBU,aes(x=x))+geom_histogram(aes(y=..density..))+ geom_density()+facet_grid(system~.) -- View this message in context: http://www.nabble.com/ggplot2-facets-as-rows-and-columns-tf4771000.html#a13647294 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.