Go from taxon names to a datelifeQuery
object
Usage
make_datelife_query2(
input = c("Rhea americana", "Pterocnemia pennata", "Struthio camelus"),
get_spp_from_taxon = FALSE,
reference_taxonomy = "ott",
...
)
Arguments
- input
Taxon names as one of the following:
- A character vector of taxon names
With taxon names as a single comma separated starting or concatenated with
c()
.- A phylogenetic tree with taxon names as tip labels
As a
phylo
ormultiPhylo
object, OR as a newick character string.
- get_spp_from_taxon
Whether to search ages for all species belonging to a given taxon or not. Default to
FALSE
. IfTRUE
, it must have same length as input. If input is a newick string with some clades it will be converted to aphylo
object, and the order ofget_spp_from_taxon
will matchphy$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".
- ...
Arguments passed on to
rotl::tnrs_match_names
context_name
name of the taxonomic context to be searched (length-one character vector or
NULL
). Must match (case sensitive) one of the values returned bytnrs_contexts
. Default to "All life".do_approximate_matching
A logical indicating whether or not to perform approximate string (a.k.a. “fuzzy”) matching. Using
FALSE
will greatly improve speed. Default, however, isTRUE
.ids
A vector of ids to use for identifying names. These will be assigned to each name in the names array. If ids is provided, then ids and names must be identical in length.
include_suppressed
Ordinarily, some quasi-taxa, such as incertae sedis buckets and other non-OTUs, are suppressed from TNRS results. If this parameter is true, these quasi-taxa are allowed as possible TNRS results.
Value
A datelifeQuery
object, which is a list of four elements:
- $input_names
A character vector of input taxon names.
- $tnrs_names
A character vector of taxon names processed with TNRS.
- $ott_ids
A numeric vector of OTT ids.
- $phy
A
phylo
object orNA
, if input is not a tree.
Details
It processes phylo
objects and newick character string inputs
with input_process()
. If input
is a multiPhylo
object, only the first phylo
element will be used. Similarly, if an input
newick character string has multiple trees,
only the first one will be used.