ohhhh. Well, it's working (replace 'group' by 'trt')
Thank you very much Hadley. david 2009/1/7 hadley wickham <h.wick...@gmail.com> > Hi David, > > > Here the problem : > > > > library(ggplot2) > > > > df <- data.frame(id = 1:100, x1 = c(rnorm(50), rnorm(50, 1)), x2 = > > c(rnorm(50), rnorm(50, 1.5)), x3 = c(rnorm(50, 0.5), rnorm(50, 2.5)), > group > > = as.factor(rep(c("a", "b"), each = 50))) > > df.melt <- melt(df, id = c("id", "group")) > > head(df.melt) > > > > p <- ggplot(df.melt, aes(variable, value)) > > p + geom_boxplot(aes(fill = group)) > > # This graph is great, but I would like to have two panels, one for group > > 'a', and one for group 'b' > > # With this code, I can't have one boxplot for each variable x1, x2 and > x3 > > p + geom_boxplot(aes(fill = group)) + facet_wrap(~group) > > # but it's working with geom_point > > p + geom_point(aes(color = group)) + facet_wrap(~group) > > This is an annoying bug I haven't figure out how to fix yet. The > basic problem is that if you facet by a variable that has the same > name as an aesthetic, it overrides that aesthetic (group in this > case). Unfortunately, currently the only work around is call the > variable something other than group. > > Regards, > > Hadley > > -- > http://had.co.nz/ > [[alternative HTML version deleted]] ______________________________________________ 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.