tipsubtree {apTreeshape} | R Documentation |
tipsubtree
returns an object of class "treeshape"
that contains pre-specified tip names or labels. The name of the tips are conserved. It extracts the smallest tree that contains the common ancestors of the given tips.
tipsubtree(tree, tips, numeric=FALSE)
tree |
An object of class "treeshape" . |
tips |
A vector that contains the names of the tips one want to keep. Warning, the names are case-sensitive. |
numeric |
An object of class "logical" . If FALSE , the vector tips contains the names of the tips. If TRUE , it contains the labels of the tips. |
An object of class "treeshape"
Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.fr>
Olivier François <olivier.francois@imag.fr>
## The universal tree of life provided in the data sets. data(universal.treeshape) ## One might want to extract the tree containing the Animals, the Plants, ## the Aquifex and the Microsporidia tree1<-tipsubtree(universal.treeshape,tips=c("Animals", "Aquifex", "Microsporidia", "Plants")) plot(universal.treeshape, tree1) ## Labels that do not appear in the tree are ignored tree2<-tipsubtree(universal.treeshape,tips=c("Human", "Animals", "Aquifex", "Microsporidia", "Plants")) plot(universal.treeshape, tree2) tree3<-tipsubtree(universal.treeshape,tips=c(1,3,7), numeric=TRUE) plot(universal.treeshape, tree3)