]> git.donarmstrong.com Git - ape.git/blob - man/multi2di.Rd
ddb0f3c20745fb0965408d1c408fc8bf38914279
[ape.git] / man / multi2di.Rd
1 \name{multi2di}
2 \alias{multi2di}
3 \alias{di2multi}
4 \title{Collapse and Resolve Multichotomies}
5 \description{
6   These two functions collapse or resolve multichotomies in phylogenetic
7   trees.
8 }
9 \usage{
10 multi2di(phy, random = TRUE)
11 di2multi(phy, tol = 1e-08)
12 }
13 \arguments{
14   \item{phy}{an object of class \code{"phylo"}.}
15   \item{random}{a logical value specifying whether to resolve the
16     multichotomies randomly (the default) or in the order they appear in
17     the tree (if \code{random = FALSE}).}
18   \item{tol}{a numeric value giving the tolerance to consider a branch
19     length significantly greater than zero.}
20 }
21 \details{
22   \code{multi2di} transforms all multichotomies into a series of
23   dichotomies with one (or several) branch(es) of length zero.
24
25   \code{di2multi} deletes all branches smaller than \code{tol} and
26   collapses the corresponding dichotomies into a multichotomy.
27 }
28 \seealso{
29 \code{\link{is.binary.tree}}
30 }
31 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
32 \value{
33   Both functions return an object of class \code{"phylo"}.
34 }
35 \examples{
36 data(bird.families)
37 is.binary.tree(bird.families)
38 is.binary.tree(multi2di(bird.families))
39 all.equal(di2multi(multi2di(bird.families)), bird.families)
40 ### To see the results of randomly resolving a trichotomy:
41 tr <- read.tree(text = "(a:1,b:1,c:1);")
42 layout(matrix(1:4, 2, 2))
43 for (i in 1:4)
44   plot(multi2di(tr), use.edge.length = FALSE, cex = 1.5)
45 layout(matrix(1))
46 }
47 \keyword{manip}