[英]Make a simple dendrogram using hierarchical clustering
我有一個簡單的距離矩陣:
I tried making my own distance matrix:
distances=matrix(c(0, 6.32, 11.3, 1, 10, 5.66, 4.24,
6.32, 0, 6.32, 6.08, 6, 2.83, 3.16,
11.3, 6.32, 0, 10.6, 2, 5.66, 7.07,
1, 6.08, 10.6, 0, 9.22, 5, 3.61,
10, 6, 2, 9.22, 0, 4.47, 5.83,
5.66, 2.83, 5.66, 5, 4.47, 0, 1.41,
4.24, 3.16, 7.07, 3.61, 5.83, 1.41, 0),nrow=7, ncol=7, byrow = TRUE)
But this doesn't cluster
> hc <- hclust(distances)
Error in if (is.na(n) || n > 65536L) stop("size cannot be NA nor exceed 65536") :
missing value where TRUE/FALSE needed
我想創建一個基於測量簇之間最小距離的樹狀圖。 最終產品如下所示:
有任何想法嗎? 幫助將不勝感激!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.