clade_dist {phylospatial} | R Documentation |
Pairwise distances among clades or nodes
Description
This function runs ape::dist.nodes()
with some additional filtering and sorting. By default,
it returns distances between every pair of non-nested clades, i.e. every pair of collateral (non-lineal) nodes
including terminals and internal nodes.
Usage
clade_dist(tree, lineal = FALSE, edges = TRUE)
Arguments
tree |
A phylogeny of class |
lineal |
Logical indicating whether to retain distances for pairs of nodes that are lineal ancestors/descendants.
If |
edges |
Logical indicating whether to return a distance matrix with a row for every edge in |
Value
A matrix of pairwise distances between nodes.
Examples
clade_dist(ape::rtree(10))