heatmap.2 specify row order OR prevent reorder?

我与影子孤独终老i 提交于 2019-12-05 09:52:17
Cath

You are not specifying Rowv=FALSE and by default the rows are reordered (in heatmap.2 help, for parameter Rowv :

determines if and how the row dendrogram should be reordered. By default, it is TRUE, which implies dendrogram is computed and reordered based on row means. If NULL or FALSE, then no dendrogram is computed and no reordering is done.

So if you want to have the rows ordered according to the last columns, you can do :

mat_data<-mat_data[order(mat_data[,ncol(mat_data)],decreasing=T),]

and then

heatmap.2(mat_data,
density.info="none",  
trace="none",         
margins =c(12,9),    
col=my_palette,       
breaks=col_breaks,   
dendrogram='none',     
Rowv=FALSE,
Colv=FALSE)     

You will get the following image :

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!