I'm trying to reproduce the heatmap presented on this blog by following their tutorial, but when I try to run their Jan 2010-code I get an error when asking for,
nba.m <- ddply(nba.m, .(variable), transform, rescale = rescale(value))
Error in eval(expr, envir, enclos) : could not find function "rescale"
Reproducible code is available on the blog mentioned above
I'm using ggplot2_0.9.0 and R 2.14.2. Also, I did read this thread here on stackoverflow.com.
Any ideas to what might be wrong?
ggplot2 doesn't seem to be loading the scales
library automatically anymore, so to use the rescale
function, you have to explicitly load library(scales)
.
When you get an error about a function not being found, the ??
command can help you find which package the function might be in, e.g. ??rescale
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With