Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heatmap without ordering and dendrogram

Tags:

r

heatmap

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.
like image 460
EpiMan Avatar asked Sep 22 '13 11:09

EpiMan


People also ask

What is dendrogram in heatmap?

A dendrogram is a tree-structured graph used in heat maps to visualize the result of a hierarchical clustering calculation. The result of a clustering is presented either as the distance or the similarity between the clustered rows or columns depending on the selected distance measure.

How do you remove a dendrogram heatmap?

Heat map dendrogramsSetting it to NA will remove the dendrogram. The Colv argument is the equivalent of Rowv but for columns. Set it to NA to remove the column dendrogram. Setting Rowv and Colv to NA will remove both dendrograms of the heat map and no reordering will be computed.

How do I order rows in heatmap R?

heatmap for a predetermined order of rows. Simply reorder the rows of your second matrix to match the first one, then use for example R's heatmap() function setting Rowv=FALSE to prevent it from automatically reordering the rows, alternatively, you could set Rowv to a vector defining the order.


1 Answers

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.

like image 62
nograpes Avatar answered Sep 22 '22 19:09

nograpes