I am trying to draw rectangles around clusters in a horizontal dendrogram. This works fine as long as I only cut the tree manually, e.g.
dend<-as.dendrogram(hc)
plot(dend, horiz=T)
rect.dendrogram(dend, 3)
However, I also want to highlight clusters found significant by pvlust()
, which so far I can only accomplish for a vertical dendrogram with pvrect()
.
I believe there is more to be done with the rect.dendrogram()
function, but I don't understand which values I need to get from pvclust()
and where to put those.
Can anyone provide a solution to this? Thanks a lot!