Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个像这样的矩阵:
a b c a 1 3 4 b 3 1 2 c 4 2 1
是否可以hclust在不将矩阵对角拼接的情况下在上三角形上使用?
hclust
structure(c(1, 3, 4, 3, 1, 2, 4, 2, 1), .Dim = c(3L, 3L), .Dimnames = list(c("a", "b", "c"), c("a", "b", "c")))
有一个强制函数 ,as.dist它将矩阵转换为 hclust 的正确类对象:
as.dist
> hclust( as.dist( m)) Call: hclust(d = as.dist(m)) Cluster method : complete Number of objects: 3