Heatmap2 code error
1
0
Entering edit mode
6.5 years ago
saj98 ▴ 140

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 • 2.0k views
ADD COMMENT
0
Entering edit mode
6.5 years ago
Zhilong Jia ★ 2.2k

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 COMMENT
0
Entering edit mode

Thank you so much, it worked

ADD REPLY

Login before adding your answer.

Traffic: 2604 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6