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

From: Rainer M Krug <r.m.krug_at_gmail.com>
Date: Mon, 28 Jan 2008 14:45:05 +0200

Hi Hadley

On 27/01/2008, hadley wickham <h.wickham_at_gmail.com> wrote:
>
> > 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 ...
>
> ggopt(strip.text = function(variable, value) paste(variable, value, sep="=
> "))

That's exactly what I was looking for - thanks.

> 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 "_")?
>
> I know it's a pain but I think emacs users need to change their ways
> (and default settings) because as time goes by I think you'll see
> increasing numbers of packages using _ instead of . to prevent
> conflicts with S3. It would be nice if R had a standard convention
> for separating words in functions.

I agree - I love that feature because it actually saves three keystrokes - but one could easily use another key for that - but a convention would be nice and would make live much easier.

Rainer

Hadley
>
>
> --
> http://had.co.nz/
>

        [[alternative HTML version deleted]]



R-help_at_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. Received on Mon 28 Jan 2008 - 12:48:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jan 2008 - 13:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive