error under "hclust" for expression data
1
0
Entering edit mode
Wang, Li ▴ 180
@wang-li-5216
Last seen 10.3 years ago
Dear List Members I am confronted with an error when doing hierarchical clustering for expression value clustering in R. > d <- dist(n, method="euclidean") Warning message: In dist(n, method = "euclidean") : NAs introduced by coercion > h <- hclust(d, method="ward") Error in hclust(d, method = "ward") : NA/NaN/Inf in foreign function call (arg 11) It seems that the NAs in my raw data affect it. I tried to remove NAs with the following two ways: d <- na.omit(d) d <- d[rowSums(!is.na(d))!=0, colSums(!is.na(d))!=0] However, they didnot solve the problem. Any comments and suggestions are very appreciated. Thanks! Li
Clustering Clustering • 14k views
ADD COMMENT
0
Entering edit mode
James F. Reid ▴ 610
@james-f-reid-3148
Last seen 10.3 years ago
Hi Li, check your data matrix, it looks like it might contain non-numeric data (from the NAs introduced by coercion warning). Try running a 'summary', ploting etc. Best. J. On 15/05/12 23:51, Wang, Li wrote: > Dear List Members > > I am confronted with an error when doing hierarchical clustering for expression value clustering in R. > >> d<- dist(n, method="euclidean") > Warning message: > In dist(n, method = "euclidean") : NAs introduced by coercion >> h<- hclust(d, method="ward") > Error in hclust(d, method = "ward") : > NA/NaN/Inf in foreign function call (arg 11) > > It seems that the NAs in my raw data affect it. > I tried to remove NAs with the following two ways: > d<- na.omit(d) > d<- d[rowSums(!is.na(d))!=0, colSums(!is.na(d))!=0] > > However, they didnot solve the problem. > > Any comments and suggestions are very appreciated. > > Thanks! > Li > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENT

Login before adding your answer.

Traffic: 819 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6