【问题标题】:R: heatmap.2 doesn't generate symmetrical plot even I set symm=TR:即使我设置了 symm=T,heatmap.2 也不会生成对称图
【发布时间】:2016-07-05 14:47:03
【问题描述】:

我有具有相同行名和列名的矩阵:Matrix

然后我使用 heatmap.2 来对称地绘制它:

heatmap.2(matrix, Rowv=T, scale='none', dendrogram="row", symm =T, col = brewer.pal(9,"Reds"))

但我得到的图像如下:

它根本不是对称的。有人可以给我一个建议吗?

谢谢,

sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RColorBrewer_1.1-2 gplots_3.0.1      

loaded via a namespace (and not attached):
 [1] htmltools_0.3.5    tools_3.3.1        yaml_2.1.13        Rcpp_0.12.5        KernSmooth_2.23-15
 [6] rmarkdown_0.9.6    gdata_2.17.0       knitr_1.13         caTools_1.17.1     digest_0.6.9      
[11] bitops_1.0-6       gtools_3.5.0      

【问题讨论】:

  • 请使用 dput() 而不是 Dropbox 链接包含您的数据。
  • 谢谢。这是我第一次提问。这个怎么样? link

标签: r heatmap gplots


【解决方案1】:

这段代码解决了我的问题:

heatmap.2(m_up, Rowv=F, Colv="Rowv", scale='none', symm =T, col = brewer.pal(9,"Reds"))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-18
    • 1970-01-01
    • 1970-01-01
    • 2011-11-02
    • 1970-01-01
    • 2020-10-03
    相关资源
    最近更新 更多