Learn R Programming

phytools (version 0.2-40)

reroot: Re-root a tree along an edge

Description

This function re-roots a phylogenetic tree at an arbitrary position along an edge.

Usage

reroot(tree, node.number, position)

Arguments

tree
a phylogenetic tree in "phylo" format.
node.number
number of the node descending from the target branch in tree$edge - this can also be a tip in which case the node number is the index number of the tip in tree$tip.label.
position
position along the target edge at which to re-root the tree.

Value

  • a phylogenetic tree in "phylo" format.

Details

This function essentially acts as a mildly sophisticated wrapper for root in the "ape" package.

References

Paradis, E., J. Claude, and K. Strimmer. 2004. APE: Analyses of phylogenetics and evolution in R language. Bioinformatics, 20, 289--290.

See Also

root