R ComplexHeatMap在盒子中添加价值并删除Dendo

时间:2018-09-08 10:37:11

标签: r

如何在R中结合这两件事? 我想隐藏树状图并显示值吗?

rerender

这显示值-

library(ComplexHeatmap)

这隐藏了树状图-

Heatmap(mat, 
name = "foo", cell_fun = function(j, i, x, y, width, height, fill) 
{
grid.text(sprintf("%.1f", mat[i, j]), x, y, gp = gpar(fontsize = 10))
}
)

数据-

heatmap(mat, Colv=NA, Rowv=NA)

1 个答案:

答案 0 :(得分:0)

要隐藏ComplexHeatmap::Heatmap中的树状图,可以使用show_row_dendshow_column_dend两个参数:

library(ComplexHeatmap)
Heatmap(mat, 
        name = "foo", cell_fun = function(j, i, x, y, width, height, fill) 
        {
          grid.text(sprintf("%.1f", mat[i, j]), x, y, gp = gpar(fontsize = 10))
        },
        show_row_dend = FALSE,
        show_column_dend = FALSE)
)

enter image description here

要安装软件包:

source("https://bioconductor.org/biocLite.R")
biocLite("ComplexHeatmap")