# Balanced trees have the minimum index for a binary tree;
# Pectinate trees the maximum:
TCIContext(8)
TotalCopheneticIndex(PectinateTree(8))
TotalCopheneticIndex(BalancedTree(8))
TotalCopheneticIndex(StarTree(8))
# Examples from Mir et al. (2013):
tree12 <- ape::read.tree(text="(1, (2, (3, (4, 5))));") #Fig. 4, tree 12
TotalCopheneticIndex(tree12) # 10
tree8 <- ape::read.tree(text="((1, 2, 3, 4), 5);") #Fig. 4, tree 8
TotalCopheneticIndex(tree8) # 6
TCIContext(tree8)
TCIContext(5L) # Context for a tree with 5 leaves.
Run the code above in your browser using DataLab