Learn R Programming

treescape (version 1.0.0)

treeVec: Tree vector function

Description

Function which takes an object of class phylo as input and outputs the vector for the Kendall Colijn metric. The elements of the vector are numeric if return.lambda.function=FALSE (default), and otherwise they are functions of lambda.

Usage

treeVec(tree, lambda = 0, return.lambda.function = FALSE)

Arguments

Value

The vector with the metric values or a function that produces the vector given a value of lambda.

Examples

Run this code
## generate a random tree
tree <- rtree(6)
## topological vector of mrca distances from root:
treeVec(tree)
## vector of mrca distances from root when lambda=0.5:
treeVec(tree,0.5)
## vector of mrca distances as a function of lambda:
vecAsFunction <- treeVec(tree,return.lambda.function=TRUE)
## evaluate the vector at lambda=0.5:
vecAsFunction(0.5)

Run the code above in your browser using DataLab