all.equal.phylo

From ape v2.7-3
0th

Percentile

Global Comparison of two Phylogenies

This function makes a global comparison of two phylogenetic trees.

Keywords
manip
Usage
## S3 method for class 'phylo':
all.equal(target, current, use.edge.length = TRUE,
use.tip.label = TRUE, index.return = FALSE,
tolerance = .Machine\$double.eps ^ 0.5,
scale = NULL, \dots)
Arguments
target
an object of class "phylo".
current
an object of class "phylo".
use.edge.length
if FALSE only the topologies are compared; the default is TRUE.
use.tip.label
if FALSE the unlabelled trees are compared; the default is TRUE.
index.return
if TRUE the function returns a two-column matrix giving the correspondence between the nodes of both trees.
tolerance
the numeric tolerance used to compare the branch lengths.
scale
a positive number, comparison of branch lengths is made after scaling (i.e., dividing) them by this number.
...
further arguments passed to or from other methods.
Details

This function is meant to be an adaptation of the generic function all.equal for the comparison of phylogenetic trees.

A single phylogenetic tree may have several representations in the Newick format and in the "phylo" class of objects used in ape'. One aim of the present function is to be able to identify whether two objects of class "phylo" represent the same phylogeny.

Value

• A logical value, or a two-column matrix.

Note

The algorithm used here does not work correctly for the comparison of topologies (i.e., ignoring tip labels) of unrooted trees. This also affects unique.multiPhylo which calls the present function. See:

https://stat.ethz.ch/pipermail/r-sig-phylo/2011-August/001562.html

encoding

latin1

all.equal for the generic Rfunction

Aliases
• all.equal.phylo
Examples
### maybe the simplest example of two representations
### for the same rooted tree...:
all.equal(t1, t2)
### ... compare with this:
identical(t1, t2)
### one just slightly more complicated...:
identical(all.equal(t3, t5), TRUE)`