Попробуйте gplots::heatmap.2
, это более продвинутое сравнение с heatmap
:
library(gplots)
library(dendextend)
library(stringi)
dat <- as.matrix(dat)
dst <- as.dist(1 - cor(t(dat), method = "spearman"))
dend <- as.dendrogram(hclust(dst))
title <- stringi::stri_unescape_unicode("I\\u2661 Heatmaps!")
heatmap.2(
x = dat,
scale = "row",
dendrogram = "row",
col = heat.colors(25),
key = F,
trace = "none",
Colv = F,
Rowv = dend,
srtCol = 0,
main = title
)
Данные:
dat <- read.table(
text = " a b c d e f g h
gene0 8.5099049 5.5732562 5.0730217 6.4162466 25.075330 19.163763 39.085439 21.368201
gene1 2.6056052 0.4082469 4.4356482 0.9731503 3.508077 41.594664 6.998682 2.742124
gene2 0.4727903 0.3678376 0.3397144 0.1221217 4.475466 2.936647 2.820639 17.592733
gene3 0.8390143 0.3199489 1.2082854 0.1856811 14.063714 4.129234 6.103459 33.116435
gene4 2.2246130 2.3719177 2.3547895 0.7456295 22.917552 7.871053 4.437163 76.596441
gene6 150.0407639 9.5132677 266.7380691 76.9122813 100.517840 61.350209 392.224464 158.130721",
stringsAsFactors = F, header = T
)