clade.matrix | R Documentation |
Takes a phylogeny in the 'ape' package format and converts it into a binary matrix showing which tips (matrix columns) subtend from each node in the phylogeny (matrix rows). This is a useful format for quickly calculating branch length information for subsets of the phylogeny.
clade.matrix(phy)
phy |
A object of class 'phylo' |
The clade matrix shows the tips from a phylogeny that subtend from each internal and external node. Each tip is represented as column showing the nodes of which it is a member and hence each row shows the tips that are members of a given node. Dropping columns gives a quick and easy way to find out which edges are retained in a particular subset of the tree and this structure is used for quickly calculating branch lengths calculations or clade statistics.
A list of class 'clade.matrix' containing the following components:
clade.matrix |
A binary m x n matrix, where m is the total number of nodes in the phylogeny and n is the number of tips. An element is 1 if tip $n_i$ subtends from a node $m_j$. |
edge.length |
A numeric vector of length m showing the edge length leading to each node in the phylogeny and named with the node number. |
tip.label |
A character vector of length n giving the labels assigned to the tips of the phylogeny. |
edge |
The edge matrix from the original phylogeny. |
David Orme
data(perissodactyla)
clade.matrix(perissodactyla.tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.