R: Subtree from the Open Tree of Life

tol_induced_subtree {rotl} | R Documentation

## Subtree from the Open Tree of Life

### Description

Return the induced subtree on the synthetic tree that relates a list of nodes.

### Usage

    tol_induced_subtree(ott_ids = NULL, node_ids = NULL,
      label_format = NULL, file, ...)

### Arguments

`ott_ids` | Numeric vector. OTT ids indicating nodes to be used as tips in the induced tree.
`node_ids` | Character vector. Node ids indicating nodes to be used as tips in the induced tree.
`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

Return a tree with tips corresponding to the nodes identified in the input set that is consistent with the topology of the current synthetic tree. This tree is equivalent to the minimal subtree induced on the draft tree by the set of identified nodes.

### 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_induced_subtree(ott_ids=c(292466, 267845, 316878, 102710))
    tree_file <- tempfile(fileext=".tre")
    tol_induced_subtree(ott_ids=c(292466, 267845, 316878, 102710),
                        file=tree_file)

    ## End(Not run)

[Package rotl version 3.0.5 Index]