Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tol_subtree

Extract a subtree from the synthetic tree


Description

Extract a subtree from the synthetic tree from an Open Tree node id.

Usage

tol_subtree(ott_id = NULL, node_id = NULL, label_format = NULL, file, ...)

Arguments

ott_id

Numeric. The ott id of the node in the tree that should serve as the root of the tree returned.

node_id

Character. The node id of the node in the tree that should serve as the root of the tree returned.

label_format

Character. Defines the label type; one of “name”, “id”, or “name_and_id” (the default).

file

If specified, the function will write the subtree to a file in newick format.

...

additional arguments to customize the API call (see rotl for more information).

Details

Given a node, return the subtree of the synthetic tree descended from that node. The start node may be specified using either a node id or an ott id, but not both. If the specified node is not in the synthetic tree an error will be returned. There is a size limit of 25000 tips for this method.

Value

If no value is specified to the file argument (default), a phylogenetic tree of class phylo. Otherwise, the function returns invisibly a logical indicating whether the file was successfully created.

Examples

## Not run: 
res <- tol_subtree(ott_id=241841)
## End(Not run)

rotl

Interface to the 'Open Tree of Life' API

v3.0.11
BSD_2_clause + file LICENSE
Authors
Francois Michonneau [aut, cre] (<https://orcid.org/0000-0002-9092-966X>), Joseph Brown [aut] (<https://orcid.org/0000-0002-3835-8062>), David Winter [aut] (<https://orcid.org/0000-0002-6165-0029>), Scott Chamberlain [rev] (<https://orcid.org/0000-0003-1444-9135>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.