ggplot2(0.9.0): could not find function "=="
Hi James,
There were a few problems with the 0.9.0 version, which is why it was
pulled from CRAN. I'd recommend re-installing 0.8.9:
install.packages("ggplot2", type = "source")
Hadley
On Wed, Feb 1, 2012 at 2:10 PM, J Toll <jctoll at gmail.com> wrote:
Hi, I have a question related to the newest version of ggplot2 (0.9.0). ?I just updated this morning and from CRAN it looks like the Mac version is the only one at 0.9.0 as of right now. http://cran.r-project.org/web/packages/ggplot2/index.html Anyway, I was in the midst of a project where I was trying to replicate "Back-to-back Bar Charts" in this blog post. http://learnr.wordpress.com/2009/09/24/ggplot2-back-to-back-bar-charts/ My project and the example in the blog post no longer work with 0.9.0. ?I just want to figure out how to fix the blog example, and then make the same changes to my own work. So this is the output:
library(ggplot2) library(plyr) library(reshape)
Attaching package: ?reshape? The following object(s) are masked from ?package:plyr?: ? ?rename, round_any
trade <- read.csv("http://pastie.org/pastes/629247/download", header = TRUE, stringsAsFactors = FALSE)
balance <- ddply(trade, .(Time), summarise, balance = sum(EXP - IMP))
trade.m <- melt(trade, id.vars = c("BEC", "Time"))
ggplot(trade.m, aes(Time)) + geom_bar(subset = .(variable ==
+ ? ? "EXP"), aes(y = value, fill = BEC), stat = "identity") +
+ ? ? geom_bar(subset = .(variable == "IMP"),
+ ? ? ? ? ? ? ?aes(y = -value, fill = BEC), stat = "identity") +
+ ? ? ? ? ? ? ? ? ?xlab("") + scale_y_continuous("Export ?- ?Import",
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?formatter = "comma")
Error in continuous_scale(c("y", "ymin", "ymax", "yend", "yintercept", ?:
?unused argument(s) (formatter = "comma")
ggplot(trade.m, aes(Time)) + geom_bar(subset = .(variable ==
+ ? ? "EXP"), aes(y = value, fill = BEC), stat = "identity") +
+ ? ? geom_bar(subset = .(variable == "IMP"),
+ ? ? ? ? ? ? ?aes(y = -value, fill = BEC), stat = "identity") +
+ ? ? ? ? ? ? ? ? ?xlab("") + scale_y_continuous("Export ?- ?Import")
Error in eval(expr, envir, enclos) : could not find function "=="
The problem appears to be with the subsetting. ?Apparently something
has changed between the versions. ?I've been trying to read about the
changes between versions but so far have found so smoking gun. ?Any
thoughts or suggestions as to the problem would be appreciated.
Thanks,
James
______________________________________________ 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.
Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/