Learn R Programming

Rtropical (version 1.2.1)

as.vector.phylo: Vectorize a Phylogenetic Tree

Description

Computes the cophenetic distance and outputs them in a vector of a phylogenetic tree in phylo object

Usage

# S3 method for phylo
as.vector(x, mode = "any")

Arguments

x

A object of class phylo

mode

The same as base::as.vector. But only numeric output in vector form is accepted for other functions in Rtropical

Value

A vector with its elements the distance between two leaves of the tree.

Examples

Run this code
# NOT RUN {
library(ape)
tree <- rcoal(5)
tree_vec <- as.vector(tree)

# }

Run the code above in your browser using DataLab