我使用cutree()将我的hclust()树聚集到几个组中.现在我想要一个函数来将几个组成员hclust()作为一个hclust()......还有:
我将一棵树切成168组,我想要168个hclust()树......我的数据是1600*1600矩阵.
我的数据太大了,所以我给你举个例子
m<-matrix(1:1600,nrow=40)
#m<-as.matrix(m) // I know it isn't necessary here
m_dist<-as.dist(m,diag = FALSE )
m_hclust<-hclust(m_dist, method= "average")
plot(m_hclust)
groups<- cutree(m_hclust, k=18)
Run Code Online (Sandbox Code Playgroud)
现在我要绘制18棵树......一组树.我试过很多..