paintSubTree {phytools} | R Documentation |
Paint sub-trees with a discrete character
Description
Paints regimes on a tree to create an object of class "simmap"
with mapped regimes.
Usage
paintSubTree(tree, node, state, anc.state="1", stem=FALSE)
paintBranches(tree, edge, state, anc.state="1")
Arguments
tree |
a phylogenetic tree as an object of class |
node |
an integer specifying the node number tipward of which the function should paint the derived state. |
edge |
an integer or vector of integers specifying the node or tip numbers of the edges that should be painted in |
state |
a string (or numeric value) specifying the state to paint on the tree tipward of |
anc.state |
the ancestral state to use; will only be applied if there are presently no character values mapped on the tree. |
stem |
logical or numeric value indicating whether to use the derived state on the stem leading to |
Details
These functions map or "paint" arbitrary (i.e., user-specified) discrete character histories on the tree.
paintSubTree
paints the clade downstream of node
with a particular state; whereas paintBranches
paints only a specified branch.
Value
An object of class "simmap"
that contains the specified paintings as a mapped discrete character.
Author(s)
Liam Revell liam.revell@umb.edu
References
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
See Also
make.simmap
, read.simmap
, plotSimmap
, sim.history