[R] Dealing with missing values in HeatMap generation

Himanshu Ardawatia Himanshu.Ardawatia at bccs.uib.no
Fri Apr 7 17:01:35 CEST 2006


Hi,

I want to generate a heatmap for my data (in a matrix). However, the 
data has some missing values (represented as blank).
I get the following errors (with the blanks and with blanks replaced by 
NA and including the option rm.na = TURE):
 > filename = "input_heatmap.txt"
 > g <- as.matrix(filedata)
 > fg <- rainbow(nrow(g), start=0, end=.3)
 > gg <- rainbow(ncol(g), start=0, end=.3)
 > hg <- heatmap(g, col = cm.colors(256), scale="column",na.rm = TRUE,
+  RowSideColors = fg, ColSideColors = gg, margin=c(5,10),
+ xlab = "Average per Species", ylab= "Pathways",
+ main = "heatmap(<Ka/Ks Average Data per Species>, ..., scale = 
\"column\")")
Error in heatmap(g, col = cm.colors(256), scale = "column", na.rm = TRUE,  :
        'x' must be a numeric matrix

Is there anyway to deal with it?

Second question: What is the basis for generation of the dendrogram 
(over the heatmap) in the heatmap? Is it simple hierarchical clustering?

Thanks in advance
Himanshu




More information about the R-help mailing list