Learn R Programming

phytools (version 0.2-40)

paintSubTree: Paint sub-trees with a discrete character

Description

This function maps an arbitrary discrete character history on the tree.

Usage

paintSubTree(tree, node, state, anc.state="1", stem=FALSE)

Arguments

tree
a phylogenetic tree as an object of class "phylo" or a modified object with mapped character traits.
node
an integer specifying the node number tipward of which the function should paint the derived state.
state
a string (or numeric value) specifying the state to paint on the tree tipward of node.
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 node (or not, if stem=FALSE), or, alternatively, what fraction of the stem should be assigned to the derived clade. Note that for tip cla

Value

  • a modified phylogenetic tree of class "phylo" with the following additional elements:
  • mapsa list of named vectors containing the times spent in each state on each branch, in the order in which they occur.
  • mapped.edgea matrix containing the total time spent in each state along each edge of the tree.

See Also

make.simmap, read.simmap, plotSimmap, sim.history