Learn R Programming

phangorn (version 1.99-12)

treedist: Distances between trees

Description

treedist computes different tree distance methods and RF.dist the Robinson-Foulds or symmetric distance.

Usage

treedist(tree1, tree2, check.labels = TRUE)
RF.dist(tree1, tree2=NULL, check.labels=TRUE)

Arguments

tree1
A phylogenetic tree (class phylo) or vector of trees (an object of class multiPhylo). See details
tree2
A phylogenetic tree.
check.labels
compares labels of the trees.

Value

  • treedist returns a vector containing the following tree distance methods
  • symmetric.differencesymmetric.difference or Robinson-Foulds distance
  • branch.score.differencebranch.score.difference
  • path.differencepath.difference
  • weighted.path.differenceweighted.path.difference

Details

The Robinson-Foulds distance is well defined only for bifurcating trees.

RF.dist returns the Robinson-Foulds distance between either 2 trees or computes a matrix of all pairwise distances if a multiPhylo object is given. For large number of trees RF.dist can use a lot of memory!

References

Steel M. A. and Penny P. (1993) Distributions of tree comparison metrics - some new results, Syst. Biol.,42(2), 126-141

Examples

Run this code
tree1 <- rtree(100, rooted=FALSE)
tree2 <- rSPR(tree1, 3)
RF.dist(tree1, tree2)
treedist(tree1, tree2)

Run the code above in your browser using DataLab