tree_imbalance {castor} | R Documentation |
Given a rooted phylogenetic tree, calculate various "imbalance" statistics of the tree, such as Colless' Index or Sackin's Index.
tree_imbalance(tree, type)
tree |
A rooted tree of class "phylo". |
type |
Character, specifying the statistic to be calculated. Must be one of "Colless" (Shao 1990), "Colless_normalized" (Colless normalized by the maximum possible value in the case of a bifurcating tree) or "Sackin" (Sackin 1972). |
The tree may include multifurcations and monofurcations. Note that the Colless Index is traditionally only defined for bifurcating trees. For non-bifurcating trees this function calculates a generalization of the index, by summing over all children pairs at each node.
Numeric, the requested imbalance statistic of the tree.
Stilianos Louca
M. J. Sackin (1972). "Good" and "Bad" Phenograms. Systematic Biology. 21:225-226.
K.T. Shao, R. R. Sokal (1990). Tree Balance. Systematic Biology. 39:266-276.
# generate a random tree Ntips = 100 tree = generate_random_tree(list(birth_rate_intercept=1),Ntips)$tree # calculate Colless statistic colless_index = tree_imbalance(tree, type="Colless")