Question: Heatmap2 code error
0
gravatar for saj98
24 months ago by
saj98110
saj98110 wrote:

Hello I am using the following code for heatmap2 heatmap.2(as.matrix(X), col=redgreen(75), scale="row", key=T, keysize=1.5, density.info="none", trace="none",cexCol=0.9, labRow=NA). The head of my data as the following: AF PPTAF/PPT ICIPF PPTPF PPT ICIAD PPTAD PPT ICI` <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> 1 155. 24.2 24.2 23.0 24.2 22.2 2 18.0 4.97 13.1 9.60 13.1 15.1 3 199. 28.4 47.8 41.3 47.8 43.8 4 12.8 2.34 6.77 9.31 6.77 8.77 5 8.22 5.76 8.76 5.76 8.76 8.76 6 13.1 22.1 21.8 20.2 11.8 15.8

When I got the heatmap, the columns were not in order. See the figure I got: https://imgur.com/a/iZml9Co Any help explain why I am not getting the columns in the same order.

Thanks a lot

R • 721 views
ADD COMMENTlink modified 24 months ago by Zhilong Jia1.6k • written 24 months ago by saj98110
0
gravatar for Zhilong Jia
24 months ago by
Zhilong Jia1.6k
London
Zhilong Jia1.6k wrote:

Add Colv=NA to heatmap.2(as.matrix(X), col=redgreen(75), scale="row", key=T, keysize=1.5, density.info="none", trace="none",cexCol=0.9, labRow=NA, Colv=NA).

For detail, see manual of gplots::heatmap.2

BTW, see How to add images to a Biostars post to get how to upload figures. https://i.imgur.com/qjNR25g.jpg instead of https://imgur.com/a/iZml9Co should be used. Thank you.

ADD COMMENTlink modified 24 months ago • written 24 months ago by Zhilong Jia1.6k

Thank you so much, it worked

ADD REPLYlink written 24 months ago by saj98110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1120 users visited in the last hour