check_ott_input: Check input for usage in other 'datelife' functions

View source: R/opentree_taxonomy.R

check_ott_inputR Documentation

Check input for usage in other datelife functions

Description

⁠check_ott_input is currently used in functions ⁠get_ott_clade(), get_ott_children(), and get_otol_synthetic_tree().

Usage

check_ott_input(input = NULL, ott_ids = NULL, ...)

Arguments

input

Optional. A character vector of names or a datelifeQuery object.

ott_ids

If not NULL, it takes this argument and ignores input. A numeric vector of ott ids obtained with rotl::taxonomy_taxon_info() or rotl::tnrs_match_names() or tnrs_match().

...

Arguments passed on to make_datelife_query

use_tnrs

Whether to use Open Tree of Life's Taxonomic Name Resolution Service (TNRS) to process input taxon names. Default to TRUE, it corrects misspellings and taxonomic name variations with tnrs_match(), a wrapper of rotl::tnrs_match_names().

get_spp_from_taxon

Whether to search ages for all species belonging to a given taxon or not. Default to FALSE. If TRUE, it must have same length as input. If input is a newick string with some clades it will be converted to a phylo object, and the order of get_spp_from_taxon will match phy$tip.label.

reference_taxonomy

A character vector specifying the reference taxonomy to use for TNRS. Options are "ott", "ncbi", "gbif" or "irmng". The function defaults to "ott".

Details

By default, it uses the ott_id argument if it is not NULL.

Value

A named numeric vector of valid Open Tree Taxonomy (OTT) ids.


phylotastic/datelife documentation built on June 9, 2024, 6:50 p.m.