Last chance! 50% off unlimited learning
Sale ends in
These two functions collapse or resolve multichotomies in phylogenetic trees.
multi2di(phy, ...)
# S3 method for phylo
multi2di(phy, random = TRUE, equiprob = TRUE, ...)
# S3 method for multiPhylo
multi2di(phy, random = TRUE, equiprob = TRUE, ...)
di2multi(phy, ...)
# S3 method for phylo
di2multi(phy, tol = 1e-08, ...)
# S3 method for multiPhylo
di2multi(phy, tol = 1e-08, ...)
an object of the same class than the input.
an object of class "phylo"
or "multiPhylo"
.
a logical value specifying whether to resolve the
multichotomies randomly (the default) or in the order they appear in
the tree (if random = FALSE
).
a logical value: should topologies generated in equal
probabilities; see details in rtree
(ignored if
random = FALSE
).
a numeric value giving the tolerance to consider a branch length significantly greater than zero.
arguments passed among methods.
Emmanuel Paradis
multi2di
transforms all multichotomies into a series of
dichotomies with one (or several) branch(es) of length zero.
di2multi
deletes all branches smaller than tol
and
collapses the corresponding dichotomies into a multichotomy.
is.binary
data(bird.families)
is.binary(bird.families)
is.binary(multi2di(bird.families))
all.equal(di2multi(multi2di(bird.families)), bird.families)
### To see the results of randomly resolving a trichotomy:
tr <- read.tree(text = "(a:1,b:1,c:1);")
layout(matrix(1:4, 2, 2))
for (i in 1:4)
plot(multi2di(tr), use.edge.length = FALSE, cex = 1.5)
layout(1)
Run the code above in your browser using DataLab