The function cuts all the branches of the phylogeny which are younger than a specific age or node (i.e. the age of the node).
cutPhylo(tree,age=NULL,node=NULL,keep.lineage=TRUE)
The function returns the cut phylogeny and plots it into the graphic device. The time axis keeps the root age of the original tree. Note, tip labels are ordered according to their position in the tree.
a phylogenetic tree. The tree needs not to be ultrametric and fully dichotomous.
the age (in terms of time distance from the recent) at which the tree must be cut
the node whose age must be used as cutting limit.
logical specifying whether lineages with no descendant
tip must be retained (see example below). Default is TRUE
.
Pasquale Raia, Silvia Castiglione, Carmela Serio, Alessandro Mondanaro, Marina Melchionna, Mirko Di Febbraro, Antonio Profico, Francesco Carotenuto
When an entire lineage is cut (i.e. one or more nodes along a path)
and keep.lineages = TRUE
, the leaves left are labeled as "l"
followed by a number.
if (FALSE) {
library(ape)
set.seed(22)
rtree(100)->tree
3->age
cutPhylo(tree,age=age)->t1
cutPhylo(tree,age=age,keep.lineage=FALSE)->t1a
cutPhylo(tree,node=151)->t2
cutPhylo(tree,node=151,keep.lineage=FALSE)->t2a
}
Run the code above in your browser using DataLab