Learn R Programming

rrnni (version 0.1.1)

tips: Extract tips from tree

Description

Extract tip labels from the object of class "phylo" or "multiPhylo"

Usage

tips(x, ...)

# S3 method for phylo tips(x, ...)

# S3 method for multiPhylo tips(x, all = FALSE, ...)

Value

a vector of tip labels, or list of vectors in case of "multiPhylo" with all=TRUE

Arguments

x

an object of class "phylo" or "multiPhylo"

...

arguments to be passed to methods

all

optional extract tips for all trees, only if x is "multiPhylo"

Details

This is convenience method, it's purpose is to easily retrieve tip labels of a tree or a collection of trees with the same tip labels. Due to this, when called on a collection of trees (an object of class "multiPhylo"), only the first tree of a collection is accessed. To obtain tip labels from all trees, specify the argument all=TRUE.

Examples

Run this code
tree = rankedPhylo(5)
tips(tree)

trees = rankedPhylo(3:7)
# only the first tree is accessed
tips(trees)

# use this to obtain all tip labels
tips(trees, all=TRUE)

Run the code above in your browser using DataLab