View source: R/tree_comparison.R
PairwiseDistances | R Documentation |
Distances between each pair of trees
PairwiseDistances(trees, Func, valueLength = 1L, ...)
trees |
List of trees of class |
Func |
Function returning a distance between two trees. |
valueLength |
Integer specifying expected length of the value returned
by |
... |
Additional arguments to |
Matrix detailing distance between each pair of trees. Identical trees are assumed to have zero distance.
Martin R. Smith (martin.smith@durham.ac.uk)
trees <- list(BalancedTree(8), PectinateTree(8), StarTree(8))
TCIDiff <- function(tree1, tree2) {
TotalCopheneticIndex(tree1) - TotalCopheneticIndex(tree2)
}
PairwiseDistances(trees, TCIDiff, 1)
TCIRange <- function(tree1, tree2) {
range(TotalCopheneticIndex(tree1), TotalCopheneticIndex(tree2))
}
PairwiseDistances(trees, TCIRange, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.