di2multi.simmap: Collapse or resolve polytomies in a tree with a character...

View source: R/utilities.R

di2multi.simmapR Documentation

Collapse or resolve polytomies in a tree with a character painted on the edges

Description

The method di2multi collapses branches of zero length (or, more specifically, branches with length shorter than tol) to create a polytomy in a tree or set of trees. The method multi2di resolves polytomies by adding branches of zero length (while preserving the mappings) in a tree or set of trees.

Usage

## S3 method for class 'simmap'
di2multi(phy, ...)
## S3 method for class 'simmap'
multi2di(phy, ...)
## S3 method for class 'multiSimmap'
di2multi(phy, ...)
## S3 method for class 'multiSimmap'
multi2di(phy, ...)
## S3 method for class 'contMap'
di2multi(phy, ...)
## S3 method for class 'contMap'
multi2di(phy, ...)
## S3 method for class 'densityMap'
di2multi(phy, ...)
## S3 method for class 'densityMap'
multi2di(phy, ...)

Arguments

phy

object of class "simmap", "multiSimmap", "contMap", or "densityMap" containing a character mapped onto the edges of a tree or set of trees.

...

optional arguments: tol, length below which edges should be treated as having zero length; and random, specifying whether to resolve polytomies randomly (if TRUE) or in the order in which they are encountered.

Details

This methods should theoretically behave similarly to di2multi and multi2di from the ape package.

Value

An object of class "simmap", "multiSimmap", "contMap", or "densityMap", depending on the class of phy.

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

contMap, densityMap, di2multi, make.simmap, multi2di, read.simmap


phytools documentation built on Sept. 2, 2022, 1:06 a.m.