Find the Neotoma datasets that contain a taxon, and return them as a sites object.

get_taxa(x = NA, ...)

# S3 method for class 'numeric'
get_taxa(x, ...)

# Default S3 method
get_taxa(...)

Arguments

x

A taxon ID (integer, or a vector of IDs) in Neotoma.

...

accepted arguments, see details for more information.

Value

A Neotoma2 sites object holding the datasets with the requested taxa, or NULL if no taxon or no dataset was found.

Details

get_taxa() works in two steps. First it resolves the taxon you supplied to taxon names, with get_taxon(). Then it asks Neotoma for the datasets that contain those names, with get_datasets(). The second step is the expensive one: the API can take a minute or more to answer a broad taxa= filter, so a taxon ID, or a name with a wildcard, that stands for many names produces a slow request. get_taxa() warns when it is about to send more than 25 distinct names, and it never sends the dataset request without a taxon filter: if no taxon is found it returns NULL.

The taxon can be given in any one of the following ways:

  • x A taxon ID (integer) in Neotoma. Can be passed as a vector of IDs.

  • taxonname A taxon name, or a partial name using % as a wildcard, which is resolved with get_taxon().

  • taxa One or more exact taxon names, used as they are.

Any other argument that get_datasets() accepts (datasettype, loc, ageyoung, ageold, limit, offset, all_data, ...) is passed on to that second step.

Author

Socorro Dominguez dominguezvid@wisc.edu

Examples

if (FALSE) { # \dontrun{
# Datasets containing taxon 1 (Abies), at most five of them:
abies <- get_taxa(1, limit = 5)
# The same, starting from the taxon name:
abies <- get_taxa(taxonname = "Abies", limit = 5)
} # }