downto.tree: Phylogenetic tree from a taxon down to a lower rank

View source: R/downto.tree.R

downto.treeR Documentation

Phylogenetic tree from a taxon down to a lower rank

Description

Expands a higher taxon to all of its descendants at a chosen rank using downstream, then builds the corresponding Open Tree of Life subtree via taxa.tree.

Usage

downto.tree(
  taxon,
  downto,
  db = "ncbi",
  key = NULL,
  source = c("otl", "fish"),
  plot = TRUE,
  verbose = TRUE
)

Arguments

taxon

A single higher taxon name (e.g. a family or genus).

downto

Target lower rank to expand down to, e.g. "species" or "genus". Must be lower than taxon's rank.

db

Taxonomic database used for the downstream expansion. Default "ncbi". "gbif" and "itis" are also supported and need no API key; prefer them if you hit NCBI rate limits.

key

NCBI Entrez API key (relevant when db = "ncbi"). When supplied it is exported as the ENTREZ_KEY environment variable for the duration of the call, so both the get_uid and downstream requests use it; the previous value is restored on exit. Create a key with use_entrez. Alternatively, set ENTREZ_KEY yourself (e.g. in .Renviron) and leave this NULL. Without a key NCBI throttles requests to 3 per second (10 with one).

source

Tree source passed to taxa.tree: "otl" (default) or "fish".

plot

Logical; plot the resulting tree(s). Default TRUE.

verbose

Logical; print progress messages. Default TRUE.

Details

Only the taxon-expansion step uses taxize; the tree itself comes from Open Tree of Life, so descendants that are absent from the Open Tree synthesis are dropped and reported in unmatched.

Value

Invisibly, the list returned by taxa.tree (trees, unmatched). Because descendants of a taxon may span more than one phylum, trees can contain more than one element.

See Also

taxa.tree

Examples

## Not run: 
# All species in the deer family:
downto.tree("Cervidae", downto = "species")

## End(Not run)

aptg documentation built on July 19, 2026, 9:07 a.m.