bold_specimens {bold}R Documentation

Search BOLD for specimens.

Description

Search BOLD for specimens.

Usage

bold_specimens(
  taxon = NULL,
  ids = NULL,
  bin = NULL,
  container = NULL,
  institutions = NULL,
  researchers = NULL,
  geo = NULL,
  response = FALSE,
  format = "tsv",
  ...
)

Arguments

taxon

(character) Returns all records containing matching taxa. Taxa includes the ranks of phylum, class, order, family, subfamily, genus, and species.

ids

(character) Returns all records containing matching IDs. IDs include Sample IDs, Process IDs, Museum IDs and Field IDs.

bin

(character) Returns all records contained in matching BINs. A BIN is defined by a Barcode Index Number URI.

container

(character) Returns all records contained in matching projects or datasets. Containers include project codes and dataset codes

institutions

(character) Returns all records stored in matching institutions. Institutions are the Specimen Storing Site.

researchers

(character) Returns all records containing matching researcher names. Researchers include collectors and specimen identifiers.

geo

(character) Returns all records collected in matching geographic sites. Geographic sites includes countries and province/states.

response

(logical) Note that response is the object that returns from the Curl call, useful for debugging, and getting detailed info on the API call.

format

(character) One of xml, json, tsv (default). tsv format gives back a data.frame object. xml gives back parsed XML as xml_document object. 'json' (JavaScript Object Notation) and 'dwc' (Darwin Core Archive) are supported in theory, but the JSON can be malformed, so we don't support that here, and the DWC option actually returns TSV.

...

Further args passed on to crul::verb-GET, main purpose being curl debugging

References

http://v4.boldsystems.org/index.php/resources/api?type=webservices

Examples

## Not run: 
bold_specimens(taxon='Osmia')
bold_specimens(taxon='Osmia', format='xml')
bold_specimens(taxon='Osmia', response=TRUE)
res <- bold_specimens(taxon='Osmia', format='xml', response=TRUE)
res$url
res$status_code
res$response_headers

# More than 1 can be given for all search parameters
bold_specimens(taxon=c('Coelioxys','Osmia'))

## curl debugging
### These examples below take a long time, so you can set a timeout so that 
### it stops by X sec
head(bold_specimens(taxon='Osmia', verbose = TRUE))
# head(bold_specimens(geo='Costa Rica', timeout_ms = 6))

## End(Not run)

[Package bold version 1.2.0 Index]