Learn R Programming

ape (version 5.6-2)

vcv2phylo: Variance-Covariance Matrix to Tree

Description

This function transforms a variance-covariance matrix into a phylogenetic tree.

Usage

vcv2phylo(mat, tolerance = 1e-7)

Value

an object of class "phylo".

Arguments

mat

a square symmetric (positive-definite) matrix.

tolerance

the numeric tolerance used to compare the branch lengths.

Author

Simon Blomberg

Details

The function tests if the matrix is symmetric and positive-definite (i.e., all its eigenvalues positive within the specified tolerance).

See Also

vcv, corPhyl

Examples

Run this code
tr <- rtree(10)
V <- vcv(tr) # VCV matrix assuming Brownian motion
z <- vcv2phylo(V)
identical(tr, z) # FALSE
all.equal(tr, z) # TRUE

Run the code above in your browser using DataLab