So, I have 256 objects, and have calculated the distance matrix (pairwise distances) among them. A subset of my distance matrix is given below:
> 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" ...
Now, I want to use this distance matrix to cluster those 256 objects accordingly. Therefore, I used hclust, but got an error:
> 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
So, even if I use a smaller subset of the matrix, I would still get the same error:
> 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
Any idea what is wrong with my analysis?