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,
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).
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).