Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 具有多行边颜色的热图_R_Heatmap - Fatal编程技术网

R 具有多行边颜色的热图

R 具有多行边颜色的热图,r,heatmap,R,Heatmap,我正在为给定的矩阵创建热图。我也有多个单独的因素,随着热图显示。现在,我可以为一个因素创建单行边颜色。但是有没有办法从gplots heatmap.2函数中为多个因素创建行边颜色呢? 换句话说,许多RowSideColor都与热图匹配。有什么建议吗?经过一番挖掘,我自己找到了解决方案,如果您指定 tmpSorted = tmp[order(rownames(tmp)),] # sorts alphabetical order heatmap.2(tmpSorted, Rowv=F ..

我正在为给定的矩阵创建热图。我也有多个单独的因素,随着热图显示。现在,我可以为一个因素创建单行边颜色。但是有没有办法从gplots heatmap.2函数中为多个因素创建行边颜色呢?
换句话说,许多RowSideColor都与热图匹配。有什么建议吗?

经过一番挖掘,我自己找到了解决方案,如果您指定

  tmpSorted = tmp[order(rownames(tmp)),]  # sorts alphabetical order
  heatmap.2(tmpSorted, Rowv=F .... ) 

选项Rowv=F有效

根据您发布的内容,我尝试在下面添加一个可复制的示例,以防其他人有类似的问题:

require(gplots)
data(mtcars)
df  <- as.matrix(mtcars[,8:11])
df = df[order(rownames(df)),]  # sorts the rows in alphabetical order
# specifying a column dendrogram
heatmap.2(df, Rowv=FALSE, dendrogram=c("column")) 
require(gplots)
数据(mtcars)
df