Hi,

I would like to plot the following data such that each plot represents the
data from a single id and the plots are grouped according to the group
variable.

data<-data.frame(id=factor(rep(1:6,each=3)),
 group=factor(c('a','a','b','c','c','c')),
 x=runif(18,0,10),
 y=rnorm(18,0,1))

The following ggplot nearly works but I would prefer to not plot the
missing combinations, i.e. each row will be a different length.

ggplot(data,aes(x=x,y=y))+geom_point(aes(color=group))+facet_grid(group~id)

Is this possible using ggplot or will I need to craft something using grid?

Thanks for any ideas.
Tom

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to