tree.zero {BAT} | R Documentation |
Convert negative branches of tree.
Description
Converts negative branch lengths of any tree to zero.
Usage
tree.zero(tree)
Arguments
tree |
A phylo object. |
Details
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.
Value
A phylo object.
Examples
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)
[Package BAT version 2.9.6 Index]