ggplot2: Quick Heatmap Plotting, reshape?

雨燕双飞 提交于 2019-12-21 05:08:57

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/10006317/ggplot2-quick-heatmap-plotting-reshape

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!