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 > ______________________________________________ [email protected] 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.
