ggplot2:快速热图绘制,重塑? [英] ggplot2: Quick Heatmap Plotting, reshape?

查看:629
本文介绍了ggplot2:快速热图绘制,重塑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图重现上显示的热图这个博客按照他们的教程,但是当我试图运行他们2010年1月的代码时,我要求一个错误,

  nba.m<  -  ddply(nba.m,。(variable),transform,rescale = rescale(value))
eval中的错误(expr,envir,enclos):找不到函数 rescale

可复制的代码位于上面提到的博客 我使用 ggplot2_0.9.0和R 2.14.2。另外,我的确在这里阅读了stackoverflow.com 。 / p>

有什么想法可能会出错?

解决方案

ggplot2 doesn' t似乎已经自动加载了 scale 库,因此要使用 rescale 函数,必须显式加载 library(scales)



当你得到一个关于找不到函数的错误时, ?? 命令可以帮助您找到函数可能在哪个包中,例如 ?? rescale


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.

这篇关于ggplot2:快速热图绘制,重塑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆