12
votes

I have a file with 2 columns and 1 million lines!! I only want to plot them without any ordering because I ordered the data. How can I make a heatmap with heatmap.2 without any dendrogram and reordering?

when I use

heatmap.2(x, dendrogram="none")

Error: cannot allocate vector of size 4660.6 Gb

but

I tried without "Rowv"

heatmap.2(x, Rowv=FALSE) 

Warning message:
In heatmap.2(x, Rowv = FALSE) :
  Discrepancy: Rowv is FALSE, while dendrogram is `column'. Omitting row dendogram.
1
You don't offer many details, but perhaps function heatmap1 in package NeatMap may be what you are after. Or maybe image which is part of the basic installation. These can create a plain heatmap. - Bryan Hanson
I think heatmap.2 wraps image. - nograpes
where does heatmap.2 come from? - Vass

1 Answers

16
votes

I think you have got both arguments there, you just have to put them together.

# Generate some sample data.
n<-1e6*2
m<-matrix(rnorm(n),ncol=2)
# Plot heatmap without reordering or dendrogram.
heatmap.2(m,dendrogram='none', Rowv=FALSE, Colv=FALSE,trace='none')

enter image description here

It is hard to imagine when it would be useful to plot so much data like this, but perhaps you have something in mind.