Learn R Programming

phytools (version 0.6-44)

map.to.singleton: Converts a mapped tree to a tree with singleton nodes

Description

The function map.to.singleton takes an object of class "phylo" with a mapped discrete character and converts it to a tree with singleton nodes, in which edge has only one state. The states for each edge are stored in names(tree$edge.length). plotTree.singletons plots a tree with singleton nodes. Finally, drop.tip.singleton drops tips from the tree leaving ancestral nodes for all remaining tips as singletons. rootedge.to.singleton converts a tree with a root edge to a tree with a singleton node instead.

Usage

map.to.singleton(tree)
plotTree.singletons(tree)
drop.tip.singleton(tree, tip)
rootedge.to.singleton(tree)

Arguments

tree

a modified object of class "phylo" with a mapped discrete character or (for plotTree.singletons a tree with singleton nodes.

tip

a tip label or vector of tip labels.

Value

An object of class "phylo" with singleton nodes. plotTree.singletons plots a tree.

If names(tree$edge.length)!=NULL it will use a different color from palette for each mapped state.

References

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

See Also

collapse.singles, drop.tip, make.simmap