Re: [R] ggplot2 - facet_grid and facet_wrap

From: David Hajage <dhajage.r_at_gmail.com>
Date: Mon, 24 Nov 2008 12:43:23 +0100

Thank you Hadley.

I've just discovered an another bug (perhaps ?) :

qplot(mpg, wt, data=mtcars)# works

qplot(mpg, wt, data=mtcars, geom = "line") # works

qplot(mpg, wt, data=mtcars) + facet_grid(cyl ~ vs) # works

qplot(mpg, wt, data=mtcars, geom = "line") + facet_grid(cyl ~ vs) Erreur dans grobs[[i, j]] <- layer$make_grob(layerd[[i, j]], details, coord) :
  types (de NULL a list) incompatibles dans l'affectation [[

david
2008/11/23 hadley wickham <h.wickham_at_gmail.com>

> Hi David,
>
> That looks like a bug! I'll look into it.
>
> Regards,
>
> Hadley
>
> On Sat, Nov 22, 2008 at 1:07 PM, David Hajage <dhajage.r_at_gmail.com> wrote:
> > Hello R users (and Hadley)
> >
> > I have another question about ggplot2 :-)
> >
> > (version 0.8)
> >
> > `dat` <-
> > structure(list(D = c("a", "b", "c", "d"), G = c(1.51520888871520,
> > 1.88812208268440, -6.60521862, 0.55968739), E = c(1.38888592256404,
> > 1.39366168665589, 1.22509259382058, 1.36617701059296), I =
> > c(6.92634958902857,
> > 6.94416045215158, 13.2179488828556, 10.1993799972675), B =
> > c(7.04367258675502,
> > 7.41361056949868, 16.3459547875, 12.968224445), F = c(1.52045742504008,
> > 1.51361354379038, 1.77077549933584, 1.64580736760918), A =
> > c(2.33837047498186,
> > 2.33805720845022, 2.20591935275643, 2.26866576271907), J =
> > c(4.33205802184905,
> > 4.41713317075078, 11.091251405, 7.21690806), H = c(2.35434145263158,
> > 2.35434145263158, 2.00170987368421, 2.26486776842105), C =
> > c(6.9118223461127,
> > 6.92991088926983, 16.1293054123787, 10.2251608535304)), .Names = c("D",
> > "G", "E", "I", "B", "F", "A", "J", "H", "C"), row.names = c(NA,
> > 4L), class = "data.frame")
> >
> > mdat <- melt(dat, id = "D")
> >
> > qplot(D, value, data = mdat, fill = D, geom = "bar") + facet_grid(~
> > variable)
> > qplot(D, value, data = mdat, fill = D, geom = "bar") + facet_wrap(~
> > variable)
> >
> >
> > The first plot is good, but I think there is a problem in the second plot
> :
> > the barplots are not in the correct order (compare "G" in the first plot
> and
> > in the second plot for example).
> >
> > I join a pdf file showing the two graphs.
> >
> > Something is wrong in my code ?
> >
> > Thank you very much.
> >
> > david
> >
> > ______________________________________________
> > 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/
>

        [[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 24 Nov 2008 - 11:46:52 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 24 Nov 2008 - 14:30:26 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