[R] ggplot faceting like lattice | variable

hadley wickham h.wickham at gmail.com
Tue Oct 14 00:32:30 CEST 2008


Hi Stephen,

It will definitely be in the next release because I just wrote the
code last week.  I'm aiming for another release early November.

Hadley

On Mon, Oct 13, 2008 at 2:07 PM, stephen sefick <ssefick at gmail.com> wrote:
> I would like to be able to do the xyplot in ggplot below.  I read in
> the archive that Hadley was working on this for the next release, and
> I can not find the documentation (Aug. 23rd).
>
> River.Mile <- c(215 ,202, 198, 190, 185, 179, 148, 119, 61)
> Cu <- rnorm(9)
> Fe <- rnorm(9)
> Mg <- rnorm(9)
> Ti <- rnorm(9)
> Ir <- rnorm(9)
> r <- data.frame(River.Mile, Cu, Fe, Mg, Ti, Ir)
>
> z <- melt.data.frame(r, id.var="River.Mile")
>
> #this is what ggplot does
> qplot(River.Mile, value, facets=(variable~.), data=z)
>
> #this is what I would like to do
> xyplot(value~River.Mile | variable, data=z)
>
> Thanks
>
> --
> Stephen Sefick
> Research Scientist
> Southeastern Natural Sciences Academy
>
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods.  We are mammals, and have not exhausted the
> annoying little problems of being mammals.
>
>                                                                -K. Mullis
>
> ______________________________________________
> 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.
>



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



More information about the R-help mailing list