tipsubtree: Extract a subtree that contains pre-specified tip names or...

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
tipsubtree(tree, tips, numeric=FALSE)

Arguments

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.

Value

An object of class "treeshape"

Author(s)

Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.fr>
Olivier Francois <olivier.francois@imag.fr>

See Also

cutreeshape

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  
## 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)

bcm-uga/apTreeshape documentation built on Sept. 26, 2019, 4:56 p.m.