label.elements: Extract Information from Tip Labels of a Phylogenetic Tree

View source: R/label.elements.R

label.elementsR Documentation

Extract Information from Tip Labels of a Phylogenetic Tree

Description

Parse tip labels of an object of class phylo and store information to a vector with the same order as the tip labels of the tree.

Usage

label.elements(x, delim = "|", returnNum = 1, returnDelim = " ", ...)

Arguments

x

The tree whose tips are to be parsed. Should be of class phylo.

delim

The symbol in the tip labels used to delimit different pieces of information.

returnNum

The place of the information desired from the tip labels. For example, if information is delimited by |, species is desired, and tips are in the following format: Quercus_rubra|ARB355|Johnson then the returnNum would be 1, as the species is the first piece of delimited information.

returnDelim

The delimitation character for the new tip labels generated.

...

Other arguments pertinent to the function strsplit.

Details

The default value for delim is a pipe (|). The default for returnNum is 1, and the default for returnDelim is a space, ' '.

Value

out

A vector of the information extracted from the tip labels of the tree, ordered corresponding to tip labels.

Author(s)

Andrew Hipp and Kasey Pham

See Also

strsplit


andrew-hipp/morton documentation built on April 7, 2024, 12:15 p.m.