Skip to content
Prev 140277 / 398513 Next

ggplot2 - facetting

On Tue, Mar 25, 2008 at 9:49 AM, Pedro de Barros <pbarros at ualg.pt> wrote:
Hi Pedro,

To do facetting, there needs to be a default dataset for the plot:

plot0<-ggplot(plotdata2)

I'd also suggest you use some of the defaults:

layer1 <- geom_point(aes(x=x, y=y))
plot0 + layer1 + facet_grid(group~.)

(scales will be automatically added)

or with qplot:

qplot(x, y, data=plotdata2, facets = group ~ .)

Hadley