spider (version 1.5.0)

polyBalance: Balance of a phylogenetic tree with polytomies

Description

This function computes the numbers of descendants for each dichotomous branch of a phylogenetic tree.

Usage

polyBalance(phy)

Arguments

phy

A tree of class `phylo'.

Value

A numeric matrix with two columns and one row for each node of the tree. The columns give the numbers of descendants on each node. Non-dichotomous nodes are reported as 'NA'.

Details

The function extends balance to allow the balance of a tree with polytomies to be calculated. When the tree is fully dichotomous, the result is identical to balance.

See Also

balance.

Examples

Run this code
# NOT RUN {
	set.seed(55)
	tr <- ape::rtree(15)
	tr2 <- ape::di2multi(tr, tol=0.02)
	polyBalance(tr)
	polyBalance(tr2)

# }

Run the code above in your browser using DataLab