ClusterTable | R Documentation |
ClusterTable
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).
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, ...)
x |
Object to convert into |
tipLabels |
Character vector specifying sequence in which to order tip labels. |
... |
Presently unused. |
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.
as.ClusterTable()
returns an object of class ClusterTable
.
Martin R. Smith (martin.smith@durham.ac.uk)
Day1985TreeTools
S3 methods for ClusterTable
objects.
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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.