Hi all, I am practising a bit with ggplot2 but I have a problem when I try to use facet_grid.
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 > 0 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 Simon Hayward ______________________________________________ R-help@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.