Learn R Programming

ggphylo (version 0.1)

tree.get.tag: Retrieves a named tag from the given node. Tags are usually loaded via NHX annotations when reading a tree file or string (see tree.read) or by loading data from an external data frame (see tree.load.tags).

Description

Retrieves a named tag from the given node. Tags are usually loaded via NHX annotations when reading a tree file or string (see tree.read) or by loading data from an external data frame (see tree.load.tags).

Usage

tree.get.tag(phylo, node, tag)

Arguments

phylo
input phylo object
node
the node index from which to retrieve the tag
tag
the name of the tag to retrieve

Value

character string corresponding to the tag value, if exists; NA otherwise.

Examples

Run this code
tree <- tree.read('((a,b[&&NHX:foo=bar]),c);')
tree.get.tag(tree, tree.node.with.label(tree, 'b'), 'foo') # gives "bar"

Run the code above in your browser using DataLab