所以,我有 256 个对象,并计算了它们之间的距离矩阵(成对距离)。下面给出了我的距离矩阵的一个子集:
> dm[1:10, 1:10]
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
[1,] 0 1 1 1 1 2 2 2 1 2
[2,] 1 0 1 1 2 1 2 2 2 1
[3,] 1 1 0 1 2 2 1 2 2 2
[4,] 1 1 1 0 2 2 2 1 2 2
[5,] 1 2 2 2 0 1 1 1 1 2
[6,] 2 1 2 2 1 0 1 1 2 1
[7,] 2 2 1 2 1 1 0 1 2 2
[8,] 2 2 2 1 1 1 1 0 2 2
[9,] 1 2 2 2 1 2 2 2 0 1
[10,] 2 1 2 2 2 1 2 2 1 0
> str(dm)
int [1:256, 1:256] 0 1 1 1 1 2 2 2 1 2 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:256] "V1" "V2" "V3" "V4" ...
现在,我想使用这个距离矩阵对这 256 个对象进行相应的聚类。因此,我使用了 hclust,但出现了错误:
> hclust(dm, method="single")
Error in if (is.na(n) || n > 65536L) stop("size cannot be NA nor exceed 65536") :
missing value where TRUE/FALSE needed
> hclust(dm, method="complete")
Error in if (is.na(n) || n > 65536L) stop("size cannot be NA nor exceed 65536") :
missing value where TRUE/FALSE needed
因此,即使我使用矩阵的较小子集,我仍然会得到相同的错误:
> hclust(dm[1:10,1:10], method="complete")
Error in if (is.na(n) || n > 65536L) stop("size cannot be NA nor exceed 65536") :
missing value where TRUE/FALSE needed
知道我的分析有什么问题吗?