tree.zero | R Documentation |
Converts negative branch lengths of any tree to zero.
tree.zero(tree)
tree |
A phylo object. |
Converts branches with negative values to zero while shortening only the two branches immediately below it by the same absolute amount to ensure the tree remains with tips at same distances and there are no polytomies.
A phylo object.
par(mfrow = c(1,2))
tree <- ape::read.tree(text='(((A:3, B:3):1,
(G:6, (H:5, I:5):1):-2):3, ((C:1, D:1):2, (E:4, F:4):-1):4);')
plot(tree)
tree = tree.zero(tree)
plot(tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.