Binary heatmap using R
1
0
Entering edit mode
3 months ago

Hi everybody.

I would like to do a binary heatmap on R, made only of 0/1, but if I have lines with only zero values the graph does not shown them and I see a blank space.

This is my code:

heatmap(x , Rowv = NA, Colv = NA, col = c("light blue", "red"), xlab = "xlab" , ylab="ylab"  , main = "title")

heatmap R • 446 views
0
Entering edit mode

What is the error message you are receiving? Can you also provide an example of your data, cannot visualise it based on your description.

0
Entering edit mode

i did not have any error, just my graph is blanked instead of being coloured. For example

0000 = all blue 0001 = 3 blue 1 red 1111 = 4 red

But the first line is blank in my resulting graph

2
Entering edit mode
3 months ago
K.patel5 ▴ 90

https://stackoverflow.com/questions/41560453/colour-zero-values-in-heatmap-2 Use heatmap.2 and add na.color = "light blue".