bind.tree

From ape v2.1-1
0th

Percentile

Binds Trees

This function binds together two phylogenetic trees to give a single object of class "phylo".

Keywords
manip
Usage
bind.tree(x, y, where = "root", position = 0)
Arguments
x
an object of class "phylo".
y
an object of class "phylo".
where
an) integer giving the number of the node or tip of the tree x where the tree y is binded ("root" is a short-cut for the root).
position
a numeric value giving the position from the tip or node given by node where the tree y is binded; negative values are ignored.
Details

The argument x can be seen as the receptor tree, whereas y is the donor tree. The root of y is then sticked on a location of x specified by where and, possibly, position. If y has a root edge, this is added as in internal branch in the resulting tree.

Value

• an object of class "phylo".

Note

For the moment, this function handles only trees with branch lengths, and does not handle node labels.

Further testing/improvements may be needed.

drop.tip, root

• bind.tree
Examples
### binds the two clades of bird orders
cat("((Struthioniformes:21.8,Tinamiformes:21.8):4.1,",
"((Craciformes:21.6,Galliformes:21.6):1.3,Anseriformes:22.9):3.0):2.1;",
file = "ex1.tre", sep = "")
cat("(Turniciformes:27.0,(Piciformes:26.3,((Galbuliformes:24.4,",
"((Bucerotiformes:20.8,Upupiformes:20.8):2.6,",
"(Trogoniformes:22.1,Coraciiformes:22.1):1.3):1.0):0.6,",
"(Coliiformes:24.5,(Cuculiformes:23.7,(Psittaciformes:23.1,",
"(((Apodiformes:21.3,Trochiliformes:21.3):0.6,",
"(Musophagiformes:20.4,Strigiformes:20.4):1.5):0.6,",
"((Columbiformes:20.8,(Gruiformes:20.1,Ciconiiformes:20.1):0.7):0.8,",
"Passeriformes:21.6):0.9):0.6):0.6):0.8):0.5):1.3):0.7):1.0;",
file = "ex2.tre", sep = "")
layout(matrix(1))