Re: [R] Error in heatmap()

From: Wolfgang Huber <huber_at_ebi.ac.uk>
Date: Sat 20 Jan 2007 - 20:10:01 GMT

Dear Yuhong,

heatmap deals gracefully with sparse occurences of NA in the matrix, but will fail if whole rows or columns are NA. Try preprocessing your xx as follows:

xx = xx[rowSums(!is.na(x))!=0, colSums(!is.na(x))!=0]

  Best wishes
   Wolfgang



Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber

> Hi,
>
>
>
> I run into following error when using heatmap() for data matrix "xx".
> Any help is appreciated? "xx" contains many "NA"s.
>
>
>
>> hv <- heatmap(data.matrix(xx))
>
> Error in hclustfun(distfun(if (symm) x else t(x))) :
>
> NA/NaN/Inf in foreign function call (arg 11)
>
>
>
> Thanks a lot.
>
>
>
> Yuhong
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Jan 21 07:15:15 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 20 Jan 2007 - 22:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.