set.seed(42)
m <- matrix(rnorm(16), 4, 4)
xsidecols <- c("#cdcd0d", "#0dcdcd", "#cd0dcd", "grey")
heatmap(m, ColSideColors = xsidecols)
在这里您可以看到我们有一个ColSide bar
,但是如果我们想增加两个频段怎么办?就像heatmap.plus中的函数ColSideColors = Mycols
一样,其中Mycols是具有两列的矩阵?
当我尝试在heatmap.2
中执行相同操作时,我收到消息:
Error in heatmap.2(as.matrix(combined_ordered_matrix), Rowv = as.dendrogram(a), :
'ColSideColors' must be a character vector of length ncol(x)