R树状图故障中的热图功能 [英] Heatmap function in R dendrogram failure

查看:113
本文介绍了R树状图故障中的热图功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的一生,我无法理解这种方法为何会失败,在此我非常感谢您多加关注:

For the life of me I cannot understand why this method is failing, I would really appreciate an additional set of eyes here:

heatmap.2(TEST,trace="none",density="none",scale="row", 
     ColSideColors=c("red","blue")[data.test.factors],
     col=redgreen,labRow="", 
     hclustfun=function(x) hclust(x,method="complete"),
     distfun=function(x) as.dist((1 - cor(x))/2))  

我得到的错误是: 行树状图排序给出了错误长度的索引

The error that I get is: row dendrogram ordering gave index of wrong length

如果我不包括distfun,则一切工作都很好,并且对hclust函数有响应.任何建议将不胜感激.

If I don't include the distfun, everything works really well and is responsive to the hclust function. Any advice would be greatly appreicated.

推荐答案

这还不能重现...

 TEST <- matrix(runif(100),nrow=10)
  heatmap.2(TEST, trace="none", density="none", 
            scale="row",
            labRow="",
            hclust=function(x) hclust(x,method="complete"),
            distfun=function(x) as.dist((1-cor(x))/2))

为我工作.我不知道redgreendata.test.factors是什么.

works for me. I don't know what redgreen or data.test.factors are.

您是否尝试过使用debug(heatmap.2)options(error=recover)(或traceback(),虽然不太可能单独使用)来跟踪错误的确切位置?

Have you tried debug(heatmap.2) or options(error=recover) (or traceback(), although it's unlikely to be useful on its own) to try to track down the precise location of the error?

> sessionInfo()
R version 2.13.0 alpha (2011-03-18 r54865)
Platform: i686-pc-linux-gnu (32-bit)
...
other attached packages:
[1] gplots_2.8.0   caTools_1.12   bitops_1.0-4.1 gdata_2.8.2    gtools_2.6.2  

这篇关于R树状图故障中的热图功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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