nodeHeights
computes the height above the root for all nodes in the tree. nodeheight
computes the height above the root for a single node.nodeHeights(tree)
nodeheight(tree, node)
"phylo"
.nodeheight
, the node for which we want to compute a height above the root.tree$edge
containing the height above the root of each node in edge
(for nodeHeights
); or a single positive number (for nodeheight
).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))
.vcvPhylo
tree<-rtree(10)
X<-nodeHeights(tree)
Run the code above in your browser using DataLab