Learn R Programming

neotoma2 (version 1.1.1)

get_taxa: get_taxa

Description

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

Usage

get_taxa(x = NA, ...)

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

# S3 method for default get_taxa(...)

Value

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

Arguments

x

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

...

accepted arguments, see details for more information.

Author

Socorro Dominguez [email protected]

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.

Examples

Run this code
if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab