Learn R Programming

TML (version 2.3.0)

tree.to.vector: Phylogenetic tree to vector

Description

A tree is converted to a vector of pairwise distances between leaves. Distance between leaves is defined as the cophenetic distance between them. Normalization is applied so that the maximum distance in the vector output is 1.

Usage

tree.to.vector(tree, normalization = TRUE)

Value

vector of pairwise distances in R^(m choose 2), where m is the number of leaves

Arguments

tree

phylogenetic tree

normalization

logical; normalize the tree if TRUE

Author

Georgios Aliatimis g.aliatimis@lancaster.ac.uk

References

Aliatimis, Georgios, Ruriko Yoshida, Burak Boyaci, James A. Grant (2023). Tropical Logistic Regression on Space of Phylogenetic Trees

Examples

Run this code
tree <- ape::read.tree(text='((A:1, B:1):2, (C:1.5, D:1.5):1.5);')
tree.to.vector(tree)

Run the code above in your browser using DataLab