I'd like to collapse branches of a dendrogram
given a tolerance cutoff.
I'm following dendextend
's collapse_branch
example.
require(dendextend)
dend <- iris[1:5,-5] %>% dist %>% hclust %>% as.dendrogram
dend %>% ladderize %>% plot(horiz = TRUE); abline(v = .2, col = 2, lty = 2)
Unlike the dendrogram
s in dendextend
's example, I'd like to replace all collapsed branches (i.e., any clade right to the vertical red dashed line) by a triangle, similar to how clades are presented in this figure (from this link):
If this is too much to ask I'd settle for cutting the branches at the tolerance cutoff.