3

I am learning about generating heatmaps using R. For this example I am using randomly generated data to test the process, but I encountered what appears to be an error or perhaps there is something am missing. Specifically, the values of Npy2r in groups A & B are the same, yet the heat map colors them differently. I am trying to understand why. Am including the R code I am using to generate the heat mapheatmap

heatmap.2(x, Rowv=F, Colv = F, scale="col", col=greenred(3), key=TRUE, symkey=FALSE,                             
      density.info="none",cexRow=1,cexCol=1,margins=c(6,11),  trace="none",srtCol=45)
Kamil S Jaron
  • 5,542
  • 2
  • 25
  • 59
Eddy Zavala
  • 179
  • 3

1 Answers1

8

You have scale="col" in the code. What you are plotting is the z-score calculated based on the value distribution per column. Try changing it to "row" or "none".

Kamil S Jaron
  • 5,542
  • 2
  • 25
  • 59
Kraken
  • 405
  • 2
  • 9