# NOT RUN {
# Generate a list of trees to compare
library('TreeTools', quietly = TRUE, warn.conflicts = FALSE)
trees <- list(bal1 = BalancedTree(1:8),
pec1 = PectinateTree(1:8),
pec2 = PectinateTree(c(4:1, 5:8)))
# Compare each tree with each other tree
CompareAll(trees, NNIDist)
# Providing FUN.VALUE yields a modest speed gain:
dist <- CompareAll(trees, NNIDist, FUN.VALUE = integer(7))
# View distances as a matrix
as.matrix(dist$lower)
# }
Run the code above in your browser using DataLab