as.vector.phylo: Vectorize a Phylogenetic Tree

View source: R/as.vector.phylo.R

as.vector.phyloR Documentation

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 class '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

library(ape)
tree <- rcoal(5)
tree_vec <- as.vector(tree)


HoujieWang/Rtropical documentation built on May 18, 2022, 11:56 a.m.