Domanda

I draw heatmap using R

library("ggplots")
heatmap.2(correlation,col=topo.colors(75), scale="none",
      key=TRUE, symkey=FALSE, density.info="none", trace="none", cexRow=0.5)

But, the heatmap is not assigned against the order of data(corrrelation). If you take a close look on the x and y labels, it is totally mixed up. So, how can I draw heatmap through just input-data ordered (x,y) format?

enter image description here

È stato utile?

Soluzione

I think you want to add Rowv=FALSE and Colv=FALSE arguments to your function.

The default is to cluster the data by rows and columns, and setting Rowv and Colv both to FALSE (or NA) will prevent this:

library("gplots")
heatmap.2(correlation,col=topo.colors(75), scale="none",
      key=TRUE, symkey=FALSE, density.info="none", trace="none", cexRow=0.5, Colv=FALSE, Rowv=FALSE)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top