1

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!

zvittorio
  • 11
  • 3
  • 1
    Based on what I can read in [the documentation](https://cran.microsoft.com/snapshot/2022-07-01/web/packages/dendextend/dendextend.pdf) of `rotate`, you'll need to specify the order in which you will want your branches. – Roman Luštrik Jul 20 '22 at 07:53

0 Answers0