Learn R Programming

phytools (version 0.2-40)

nodeHeights: Compute the heights above the root of each node

Description

This function computes node heights (primarily for estDiversity).

Usage

nodeHeights(tree)

Arguments

tree
is a phylogenetic tree in "phylo" format.

Value

  • a matrix of the same dimensions as tree$edge containing the height above the root of each node in edge.

Details

The function 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)).

See Also

estDiversity, fitDiversityModel

Examples

Run this code
tree<-rtree(10)
  X<-nodeHeights(tree)

Run the code above in your browser using DataLab