2 facetting bugs?

7 views
Skip to first unread message

Elaine

unread,
Mar 24, 2009, 1:53:35 PM3/24/09
to ggplot2
I have recently run into two problems with facetting that appear to be
bugs. I'd like to know if 1) I am doing something wrong, 2) these are
known bugs, or 3) these are not known (in which case I will provide a
reproducible example).

Problem #1:
When I use facet_wrap and specify ncol or nrow in a way that creates a
single row or column it crashes my R session. For example, if I have
a factor with 3 levels, and I specify ncol=3 or nrow=1, it crashes
either way. (I now realize that I can do this with facet_grid( . ~
Factor), too)

Problem #2:
I have found that when I use facet_wrap with two factors to the right
of the tilde (i.e. facet_wrap( ~ Var1 + Var2)), I do not get the
correct plot. That is, I get a plot that looks like it is what I
want, but the data is not correct. I'm guessing it is the labels that
are wrong rather than the data itself.

Kasper Daniel Hansen

unread,
Mar 24, 2009, 2:20:24 PM3/24/09
to Elaine, ggplot2

I have reported bug 2 to Hadley, not sure if he has fixed it yet. But
it is certainly a bug. In my diagnosis the labels of the plots need to
be transposed, so the label of plot (i,j) needs to be taken from the
current plot labels from plot (j,i). Perhaps you can check if that
would fix your example as well.

Kasper

hadley wickham

unread,
Mar 24, 2009, 4:22:23 PM3/24/09
to Kasper Daniel Hansen, Elaine, ggplot2
> I have reported bug 2 to Hadley, not sure if he has fixed it yet. But
> it is certainly a bug. In my diagnosis the labels of the plots need to
> be transposed, so the label of plot (i,j) needs to be taken from the
> current plot labels from plot (j,i). Perhaps you can check if that
> would fix your example as well.

Both bugs are fixed in the current development version. I had hoped
to have a release out already, but I just got the book proofs back
from the copyeditor so I'm busy making changes. Hopefully by the end
of next week.

Hadley

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

Reply all
Reply to author
Forward
0 new messages