I clustered my hclust() tree into several groups with cutree(). Now I want a function to hclust() the several groupmembers as a hclust()... ALSO:
I cut one tree into 168 groups and I want 168 hclust() trees... My data is a 1600*1600 matrix.
My data is tooooo big so I give you an example
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)
Now I want to plot 18 trees... one tree for one group. I've tried a lot..
I warn you upfront that for such large trees, probably most solutions would be a bit slow to run. But here is one solution (using the dendextend R package):
Let's do it again on a "nicer" tree: