treeshape {apTreeshape}  R Documentation 
treeshape
builds a tree of class "treeshape"
from a n*2 matrix, where n is the number of internal nodes of the tree. There are no informations about the heights of the branches in an object of class "treeshape"
. Formally, a "tree shape" is a phylogenetic tree where the label of the tips are ignored. Here, the label of the tips can be kept or ignored. If a names
vector is provided, then the names of species are attached to the tips of the tree. Otherwise, tips are simply labeled with their numbers in the tree. Trees of class "treeshape"
are always binary.
treeshape(nodes, names)
nodes 

names 

A tree of class "treeshape"
is a fully dichotomous binary tree. The purpose of the class "treeshape"
is to study the topology of phylogenetic trees. The heights of branches are not provided for a tree of that class because we mainly focus on the balance aspect of the trees. The 'i'th row of the nodes matrix represents the children of the node number i in the tree (nodes[i,1]
being the left child, and nodes[i,2]
being the right child). A positive value represents an internal node, while a negative one stands for a tip of the tree. The last row always represents the children of the root of the tree.
An object of class "treeshape"
Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.fr>
Olivier Francois <olivier.francois@imag.fr>
Semple, C. and Steel, M. (2003) Phylogenetics. Oxford Lecture Series In Mathematics and its Applications, 24, for the mathematical definitions and tools for phylogenetic trees.
## Nodes will define the nodes of a five tips tree nodes<matrix(nrow=4,ncol=2) nodes[1,]<c(5,4) nodes[2,]<c(1,1) nodes[3,]<c(3,2) nodes[4,]<c(2,3) ## Now we can build the tree and plot it. tree1<treeshape(nodes) plot(tree1) ## Computation of the sackin index for the tree : sackin(tree1) ## Label will define the names of the tips label=c("a", "b", "c", "d", "e") tree2<treeshape(nodes, label) plot(tree1, tree2)