Winston Chang
unread,Jun 19, 2009, 12:18:00 AM6/19/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
I tried "adding" two variables in a faceting formula for facet_wrap, and it just threw some errors. I even tried an example directly from the help page for facet_wrap, and that didn't work. Is this a bug?
# These are equivalent, and neither works
qplot(mpg, wt, data=mtcars, facets = vs + am ~ . )
qplot(mpg, wt, data=mtcars) + facet_grid(vs + am ~ . )
#Error in rbind(c("spacer", "strip_h", "spacer"), c("axis_v", "axis_v", :
# number of columns of matrices must match (see arg 2)
#In addition: Warning message:
#In rbind(list(1, 1, 1), list(0.450050427161222, 1, 0.524033385806113, :
# number of columns of result is not a multiple of vector length (arg 1)
qplot(mpg, wt, data=mtcars, facets = . ~ vs + am )
#Error in cbind("spacer", c("strip_h", "strip_h", "strip_h", "strip_h", :
# number of rows of matrices must match (see arg 2)
# This works
qplot(mpg, wt, data=mtcars, facets = vs ~ am)
# facet_wrap seems to work
qplot(mpg, wt, data=mtcars) + facet_wrap( ~ vs+am)
-Winston