Learn R Programming

phytools (version 2.3-0)

di2multi.simmap: Collapse or resolve polytomies in a tree with a character painted on the edges

Description

Collapses or resolves polytomies in special types of phylogenetic trees. (See di2multi and multi2di.)

Usage

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

Value

An object of class "simmap", "multiSimmap", "contMap", or "densityMap", depending on the class of 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.

Author

Liam Revell liam.revell@umb.edu

Details

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.

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

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

See Also

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