SPRDist {TreeDist} | R Documentation |
Approximate Subtree Prune and Regraft distance
Description
Approximate the Subtree Prune and Regraft (SPR) distance.
Usage
SPRDist(tree1, tree2 = NULL, symmetric = TRUE)
Arguments
tree1 , tree2 |
Trees of class |
symmetric |
Logical specifying whether to produce a better heuristic
by calculating the minimum of |
Details
SPRDist()
is a wrapper for the function
SPR.dist()
in the phangorn package.
It pre-processes trees to ensure that their internal representation does
not cause the SPR.dist()
function to crash R, and allows an improved
(but slower) symmetric heuristic.
A memory leak is present in phangorn v2.5.5. To avoid a drain on system
resources, install the latest version of phangorn with
devtools::install_github("KlausVigo/phangorn")
.
Value
SPRDist()
returns a vector or distance matrix of distances
between trees.
Author(s)
Martin R. Smith (martin.smith@durham.ac.uk)
See Also
Other tree distances:
JaccardRobinsonFoulds()
,
KendallColijn()
,
MASTSize()
,
MatchingSplitDistance()
,
NNIDist()
,
NyeSimilarity()
,
PathDist()
,
Robinson-Foulds
,
TreeDistance()
Examples
library("TreeTools", quietly = TRUE)
SPRDist(BalancedTree(7), PectinateTree(7))
SPRDist(BalancedTree(7), as.phylo(0:2, 7))
SPRDist(as.phylo(0:2, 7), PectinateTree(7))
SPRDist(list(bal = BalancedTree(7), pec = PectinateTree(7)),
as.phylo(0:2, 7))
CompareAll(as.phylo(30:33, 8), SPRDist)