I have this huge data frame (1558 obs of 2431 variables) filled with NA
's and 1
'
I need to plot an image in which every blank (NA
) field is filled with yellow and every 1
field is filled with green but every example I find has a much more simpler data frame or they don't have binary observations so I can't adapt their code to my problem.
I need to plot something like this. I extracted a portion of my data frame and took this screenshot after creating a few conditions in Microsoft Excel.
Thanks in advance.
Here's an alternative that uses
image
. There are some caveats to this approach: it converts yourNA
values to-1
for the purpose of plotting, and must use a matrix. So, your mileage may vary depending on what you need this for, but it's a quick way to visualize if that's all you're after.Here's a start: