[R] using facet_grid() from ggplot2 with additional text in labels

Rainer M Krug r.m.krug at gmail.com
Sat Jan 26 14:15:20 CET 2008


I am using ggplot2 at the moment and I must say it is definitely better 
then ggplot - good work.

My problem is that I am using facet_grid() in the following way:

 > p <- ggplot(ssq, aes(x=year, y=-log(ssq)))
 > p + geom_point() + facet_grid(me*gi~cs*rz)

and it works nicely, except that I would like to have, in naddition to 
the values of me, gi, cs and rz the name of the variable. I.e: if gi is 
1, 2 and 3 I would like to have "gi = 1:", "gi = 2" and "gi = 3" as 
labels of the p[anels. I did it with ggplot, but I don't remember and I 
have lost the code ...

Just a small comment on the package: as I am using emacs with ess, I 
have to press "_" twice to get the underscore in the commands (as the 
first one is replaced with "->" and then reverted to "_") - would it be 
possible to change these in the next release with "." (but still provide 
an alias with "_")?

Thanks a lot


More information about the R-help mailing list