Question regarding the Heatmap function
0
0
Entering edit mode
Dongxiao Zhu ▴ 20
@dongxiao-zhu-1092
Last seen 11.3 years ago
Hi all, I wish to plot a Boolean matrix, in which "1" is represented by black and "0" is represented by white. I first initialize a simple Boolean matrix, then issue the following command: > dd [,1] [,2] [,3] [,4] [,5] a 1 1 1 1 1 b 1 1 1 1 0 c 0 0 0 0 0 > heatmap(dd, col = c(0,1), Rowv = NA, Colv = NA) Presumably, the first row should be all black because all entries are "1", and the third row should be all white cause all entries are "0". But the heatmap shows both the first and third rows are white. When I use a large matrix with more rows, all rows but the first one (supposed to be all black) are displayed correctly. Can somebody help me out? Thanks. Dognxiao
• 891 views
ADD COMMENT

Login before adding your answer.

Traffic: 1094 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