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
