nodeHeights: Compute the heights above the root of each node
Description
nodeHeights computes the height above the root for all nodes in the tree. nodeheight computes the height above the root for a single node.
Usage
nodeHeights(tree)
nodeheight(tree, node)
Arguments
tree
a phylogeny as an object of class "phylo".
node
for nodeheight, the node for which we want to compute a height above the root.
Value
Either a matrix of the same dimensions as tree$edge containing the height above the root of each node in edge (for nodeHeights); or a single positive number (for nodeheight).
Details
The function nodeHeights also gives a handy way to get the total length of the tree from the root to the heighest tip which will be given by max(nodeHeights(tree)).
References
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.