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