Hi all,
I was just rerunning my code and noticed there have been some changes
in the ggplot2 package. Most notably muted(color) is now available
only through loading the "scales" package and in addition I found a
problem with "rescale" parameter in scale_fill_gradientn. Here's the
reproducible code of an example similar to my code, from
http://had.co.nz/ggplot2/scale_gradientn.html :
dsub <- subset(diamonds, x > 5 & x < 6 & y > 5 & y < 6)
dsub$diff <- with(dsub, sqrt(abs(x-y))* sign(x-y))
(d <- qplot(x, y, data=dsub, colour=diff))
max_val <- max(abs(dsub$diff))
values <- seq(-max_val, max_val, length = 11)
d + scale_colour_gradientn(colours = topo.colors(10), values = values,
rescale = FALSE)
This returns an error:
Error in scale$oob(scale$rescaler(x, from = limits)) :
attempt to apply non-function
So am I to understand rescale is now a function in the new package
"scales". Could anyone be so kind to provide a new syntax of setting
"rescale=FALSE" as in the previous version of ggplot2.
Thanks and much appreciated,
Igor