talgalili / dendextend

Extending R's Dendrogram Functionality
152 stars 28 forks source link

Mixed up branches after unbranch #88

Closed samperochkin closed 5 years ago

samperochkin commented 5 years ago

Great package. In an algorithm I'm designing, I need to apply unbranch to some subtrees/subdends. Doing this mixes up the branches in the sense that, for a subdend of length, say, 4,

unbranch( dend=(sub1, sub2, sub3) , 2 ) = (sub21, ..., sub24, sub1, sub3)

rather than

unbranch( dend=(sub1, sub2, sub3) , 2 ) = (sub1, sub21, ..., sub24, sub3).

Unfortunately, the ordering of the subdends sometimes have a particular purpose or meaning (which is my situation). I changed your code slightly and created a pull request (for you to judge).

samperochkin commented 5 years ago

Now part of a PR. #87