# multi2di

From ape v2.7-3
0th

Percentile

##### Collapse and Resolve Multichotomies

These two functions collapse or resolve multichotomies in phylogenetic trees.

Keywords
manip
##### Usage
multi2di(phy, random = TRUE)
di2multi(phy, tol = 1e-08)
##### Arguments
phy
an object of class "phylo".
random
a logical value specifying whether to resolve the multichotomies randomly (the default) or in the order they appear in the tree (if random = FALSE).
tol
a numeric value giving the tolerance to consider a branch length significantly greater than zero.
##### Details

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.

##### Value

• Both functions return an object of class "phylo".

is.binary.tree

• multi2di
• di2multi
##### Examples
data(bird.families)
is.binary.tree(bird.families)
is.binary.tree(multi2di(bird.families))
all.equal(di2multi(multi2di(bird.families)), bird.families)
### To see the results of randomly resolving a trichotomy:
layout(matrix(1))