get_downloads: get_downloads

View source: R/get_downloads.R

get_downloadsR Documentation

get_downloads

Description

Information for Fossil Datasets

Usage

get_downloads(x = NA, verbose = TRUE, ...)

Arguments

x

Use a single number to extract site information

verbose

Status bar of items being downloaded

...

accepted arguments: sites, datasets

Details

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

Value

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:

\code{siteid}

site ID number

\code{sitename}

site's name

\code{location}

sf object that describes site's location

\code{description}
\code{collunits}

limited information on collunits

Each "collection unit" embedded in the "sites" object contains 6 parameters that can be accessed as well:

\code{collunitid}

collection unit ID number

\code{handle}

collection unit's handle

\code{collunitname}

collection unit's name

\code{colldate}

date in collection unit

\code{substrate}

substrate

\code{location}

sf object that describes site's location

\code{datasets}

detailed information regarding dataset

Each "dataset" nested in the "collection unit" contains the following detail of information:

\code{datasetid}

dataset ID number

\code{datasetname}

site's name

\code{datasettype}

type of data found

\code{location}

sf object that describes site's location

\code{notes}

notes on the dataset

\code{taxa table}

taxa table

\code{pi list}

P.I. info

\code{analyst}

analyst info

\code{metadata}

dataset metadata

Author(s)

Socorro Dominguez s.dominguez@ht-data.com

Examples


# To find the downloads object of dataset 24:
downloads24 <- get_downloads(24)

# 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]]]}'
brazil_datasets <- get_datasets(loc = brazil[1])
brazil_downloads <- get_downloads(brazil_datasets)


neotoma2 documentation built on May 29, 2024, 6:21 a.m.