Find the maximum height of tips in the tree.

maxHeight(tree, normalise = FALSE)

Arguments

tree

a tree of class phylo or phylo4. The tree should be binary and rooted; if not it will be coerced into a binary rooted tree using multi2di, if possible.

normalise

option to normalise the result, default is FALSE.

Value

An integer giving the maximum height of tips in the tree.

Author

Michelle Kendall michelle.louise.kendall@gmail.com

Caroline Colijn c.colijn@imperial.ac.uk

Examples

## Maximum height of tips in a random tree with 10 tips:
tree <- rtree(10)
plot(tree)

maxHeight(tree) 
#> [1] 6
maxHeight(tree, normalise=TRUE)
#> [1] 0.6666667