calcDstMtrx: Calculate the distance matrix

Description Usage Arguments Details See Also Examples

View source: R/calc-methods.R

Description

Returns a distance matrix for specified ids of a tree.

Usage

1
calcDstMtrx(tree, ids, parallel = FALSE, progress = "none")

Arguments

tree

TreeMan object

ids

IDs of nodes/tips

parallel

logical, make parallel?

progress

name of the progress bar to use, see create_progress_bar

Details

The distance between every id in the tree is calculated by summing the lengths of the branches that connect them. This can be useful for testing the distances between trees, checking for evoltuionary isolated tips etc. Parallelizable.

See Also

calcDstBLD, calcDstRF, calcDstTrp https://github.com/DomBennett/treeman/wiki/calc-methods

Examples

1
2
3
4
5
6
7
8
# checking the distance between two trees
library(treeman)
tree_1 <- randTree(10)
tree_2 <- randTree(10)
dmat1 <- calcDstMtrx(tree_1, tree_1['tips'])
dmat2 <- calcDstMtrx(tree_2, tree_2['tips'])
mdl <- cor.test(x=dmat1, y=dmat2)
as.numeric(1 - mdl$estimate)  # 1 - Pearson's r

Example output

[1] 0.4014857

treeman documentation built on July 8, 2020, 7:28 p.m.