[R] Problem with facet_grid in ggplot2
SHayward at agenda21digital.com
Mon Apr 11 18:33:42 CEST 2011
I am practising a bit with ggplot2 but I have a problem when I try to
The following code:-
p <- ggplot(diamonds, aes(carat, ..density..)) +
+ geom_histogram(binwidth = 1)
p + facet_grid(cut ~ clarity, margins=TRUE)
produce the following error:-
Error in class(output[[var]]) <- class(value) :
cannot set class to "array" unless the dimension attribute has length
I have lifted this code directly from the ggplot2 documentation!
By a process of elimination it seems that the problem arises from the
use of margins.
I do not know why the dimension attribute is conflicting with margins
unless it is something to do with the properties of the data frame.
I am running R 2.12.1
Has the source code changed?
Very grateful for any help
More information about the R-help