Learn R Programming

ggphylo (version 0.1)

tree.read.nhx: Reads a tree annotated with NHX-formatted annotations. A phylo object is returned, with annotations stored as tag-value lists. Several convenience functions are provided for accessing these annotations; see 'See Also' below.

Description

Reads a tree annotated with NHX-formatted annotations. A phylo object is returned, with annotations stored as tag-value lists. Several convenience functions are provided for accessing these annotations; see 'See Also' below.

Usage

tree.read.nhx(str, coming.from.tree.read = F)

Arguments

str,
a string containing the NHX-formatted tree
coming.from.tree.read,
a boolean indicating whether this function is being called from within the tree.read function. Since this function may call tree.read if no NHX annotations are detected, this is required to avoid an infinite loop.

Value

phylo object containing the tree and associated annotations.

Examples

Run this code
str <- '((a,b[&&NHX:foo=bar]),c);'
x <- tree.read.nhx(str)
print(tree.get.tags(x, tree.find(x, 'b')))
print(as.character(x))

Run the code above in your browser using DataLab