rnni | R Documentation |
Calculate Ranked Nearest Neighbour Interchange (RNNI) distance.
rnni(x, y, normalize = FALSE)
x |
a tree of class "rankedPhylo" |
y |
a tree of class "rankedPhylo" |
normalize |
normalize the distance to the maximum distance of diameter |
The RNNI distance is the shortest distance between two trees in the RNNI space, which is defined
by rank and NNI moves. This space is defined only for ranked trees. Non-ranked ultrametric
trees can be coerced to ranked trees with as_ranked
or rankedPhylo
functions.
The distance can be normalized to the maximum possible distance, the diameter of the tree-space.
The diameter is defined as (n-1)(n-2)/2
, where n
is the number of tips/leaves.
The used algorithm implements the TREEPATH algorithm described in Collienne (2021).
an integer RNNI distance between x
and y
Collienne, L. (2021). Spaces of Phylogenetic Time Trees. University of Otago.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.