ClusterTable: Convert phylogenetic tree to 'ClusterTable'

ClusterTableR Documentation

Convert phylogenetic tree to ClusterTable

Description

as.ClusterTable() converts a phylogenetic tree to a ClusterTable object, which is an internal representation of its splits suitable for rapid tree distance calculation (per Day, 1985).

Usage

as.ClusterTable(x, tipLabels = NULL, ...)

## S3 method for class 'phylo'
as.ClusterTable(x, tipLabels = NULL, ...)

## S3 method for class 'list'
as.ClusterTable(x, tipLabels = NULL, ...)

## S3 method for class 'multiPhylo'
as.ClusterTable(x, tipLabels = NULL, ...)

Arguments

x

Object to convert into ClusterTable: perhaps a tree of class phylo.

tipLabels

Character vector specifying sequence in which to order tip labels.

...

Presently unused.

Details

Each row of a cluster table relates to a clade on a tree rooted on tip 1. Tips are numbered according to the order in which they are visited in preorder: i.e., if plotted using plot(x), from the top of the page downwards. A clade containing the tips 2 .. 5 would be denoted by the entry ⁠2, 5⁠, in either row 2 or row 5 of the cluster table.

Value

as.ClusterTable() returns an object of class ClusterTable.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

References

\insertRef

Day1985TreeTools

See Also

S3 methods for ClusterTable objects.

Examples

tree1 <- ape::read.tree(text = "(A, (B, (C, (D, E))));");
tree2 <- ape::read.tree(text = "(A, (B, (D, (C, E))));");
ct1 <- as.ClusterTable(tree1)
summary(ct1)
as.matrix(ct1)

# Tip label order must match ct1 to allow comparison
ct2 <- as.ClusterTable(tree2, tipLabels = LETTERS[1:5])

TreeTools documentation built on Sept. 11, 2024, 8:27 p.m.