Learn R Programming

ape (version 5.8-1)

cophenetic.phylo: Pairwise Distances from a Phylogenetic Tree

Description

cophenetic.phylo computes the pairwise distances between the pairs of tips from a phylogenetic tree using its branch lengths.

dist.nodes does the same but between all nodes, internal and terminal, of the tree.

Usage

# S3 method for phylo
cophenetic(x)
dist.nodes(x, fail.if.no.length = FALSE)

Value

a numeric matrix with colnames and rownames set to the names of the tips (as given by the element tip.label of the argument

phy), or, in the case of dist.nodes, the numbers of the tips and the nodes (as given by the element edge).

Arguments

x

an object of class "phylo".

fail.if.no.length

a logical values. If the tree has no branch lengths, these are all fixed to one (with a warning) so the computation is done. If you prefer to catch the case of no branch lengths with an error, set this option to TRUE.

Author

Emmanuel Paradis

See Also

read.tree to read tree files in Newick format, cophenetic for the generic function