Rotating dendogram branches when you have thousands of them

141 Views Asked by At

I have been working with the R package dendextend for producing a dendogram while being able to rotate some of its branches. What I have is a dendrogram with more than 8000 branches. I want to flip some of the main ones, basically pivoting their connecting branch. This is the code I am using:

 dend_columns = mat %>%
  t() %>%
  dist(method = "manhattan") %>%
  hclust(method = "ward.D") %>%
  dendextend::rotate(8265:1)

where mat is a 66x8265 matrix of values in the range of 0 and 1. Now, this code simply produces the mirror image of the dendogram through the rotate() function. But what if I want to rotate specific branches only?

Thank you in advance!

0

There are 0 best solutions below