Download sites objects up to datum and chronology detail level.
get_downloads(x, verbose = TRUE, ...)
# S3 method for class 'numeric'
get_downloads(x, ...)
# S3 method for class 'sites'
get_downloads(x, verbose = TRUE, ...)The function returns either a single item of class
"try-error" describing the reason for failure
(either misdefined parameters or an error from the Neotoma API),
or a table of sites, with rows corresponding to the number of
individual sites and datasets returned by the Neotoma API.
Each "site" object contains 6 parameters that can be accessed as well:
siteid site ID number
sitename site's name
location sf object that describes site's location
description collunits limited information on collunits
Each "collection unit" embedded in the "sites" object contains 6 parameters that can be accessed as well:
collunitidcollection unit ID number
handle collection unit's handle
collunitname collection unit's name
colldate date in collection unit
substrate substrate
location sf object that describes site's location
datasets detailed information regarding dataset
Each "dataset" nested in the "collection unit" contains the following detail of information:
datasetid dataset ID number
datasetname site's name
datasettype type of data found
location sf object that describes site's location
notes notes on the dataset
taxa table taxa table
pi list P.I. info
analyst analyst info
metadata dataset metadata
The get_downloads() command wraps the Neotoma API
(api.neotomadb.org) call for downloads.
The call itself uses a SQL query which accepts any one of the following
parameters:
datasetid The unique dataset ID (integer) in Neotoma. Can be passed
as a vector of dataset IDs.
all_data The API only downloads the first 25 records of the query.
For the complete records, use all_data=TRUE
# \donttest{
# To find the downloads object of dataset 24:
tryCatch({
downloads24 <- get_downloads(24)
}, error = function(e) {
message("Neotoma server not responding. Try again later.")
})
# To find all downloads in Brazil
brazil <- '{"type": "Polygon",
"coordinates": [[
[-73.125, -9.102096738726443],
[-56.953125,-33.137551192346145],
[-36.5625,-7.710991655433217],
[-68.203125,13.923403897723347],
[-73.125,-9.102096738726443]]]}'
tryCatch({
brazil_datasets <- get_datasets(loc = brazil[1])
brazil_downloads <- get_downloads(brazil_datasets)
}, error = function(e) {
message("Neotoma server not responding. Try again later.")
})
# }