Learn R Programming

phytools (version 2.3-0)

map.to.singleton: Converts a tree without singletons to a tree with singleton nodes

Description

map.to.singleton takes an object of class "simmap" with a mapped discrete character and converts it to a tree with singleton nodes, in which edge has only one state.

Usage

map.to.singleton(tree)
plotTree.singletons(tree)
# S3 method for singleton
drop.tip(phy, tip, ...)
rootedge.to.singleton(tree)

Value

An object of class "phylo" with singleton nodes. plotTree.singletons graphs a tree in which the singleton nodes are shown.

If names(tree$edge.length)!=NULL

plotTree.singletons will use a different color from palette for each mapped state.

Arguments

tree

an object of class "simmap" (for map.to.singleton, or a tree with one or more singleton nodes (for plotTree.singletons, drop.tip.singleton, and rootedge.to.singleton).

phy

for drop.tip.singleton, an object of class "singleton" or "phylo".

tip

for drop.tip.singleton, a tip label or vector of tip labels.

...

optional arguments for drop.tip.singleton.

Author

Liam Revell liam.revell@umb.edu

Details

The states for each edge are stored in names(tree$edge.length). In a sense this is just an alternative way to use the general structure of the "phylo" object to encode a tree with a mapped character.

plotTree.singletons plots a tree with singleton nodes. Note that plotTree and plot.phylo now have no trouble graphing trees with singleton nodes - but they do this by just ignoring the singletons. plotTree.singletons marks the singletons as nodes on the plotted phylogeny.

drop.tip.singleton drops tips from the tree leaving ancestral nodes for all remaining tips as singletons.

Finally, rootedge.to.singleton converts a tree with a root edge to a tree with a singleton node instead.

References

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

See Also

collapse.singles, drop.tip, make.simmap