nodeDepthFrac: Fraction of nodes beyond a given depth

View source: R/nodeDepthFrac.R

nodeDepthFracR Documentation

Fraction of nodes beyond a given depth

Description

Calculate the fraction of nodes with a depth greater than or equal to a given threshold.

Usage

nodeDepthFrac(tree, threshold)

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.

threshold

a threshold value for node depth.

Value

The fraction of nodes with a depth greater than or equal to the threshold (see nodeDepth for more details on the meaning of node depth).

Author(s)

Michelle Kendall michelle.louise.kendall@gmail.com

See Also

nodeDepth

Examples

## Find the fraction of nodes with a depth of 5 or more, in a random tree with 20 tips:
tree <- rtree(20)
tree$edge.length <- rep(1,38) # so that the depths are easier to view in a plot
plot(tree)
nodeDepthFrac(tree,threshold=5) 


phyloTop documentation built on Feb. 16, 2023, 5:55 p.m.