This is a function to retrieve a data table from the NEON data portal for sites and dates provided by the enduser. NOTE that this function only works for NEON Observation System (OS) data products, and only for select tables
getDatatable(
dpid = NA,
data_table_name = NA,
sample_location_list = NA,
sample_location_type = "siteID",
sample_date_min = "2012-01-01",
sample_date_max = Sys.Date(),
sample_date_format = "%Y-%m-%d",
data_package_type = "basic",
url_prefix_data = "https://data.neonscience.org/api/v0/data/",
url_prefix_products = "https://data.neonscience.org/api/v0/products/",
token = NA_character_
)
data frame with selected NEON data
character sting for NEON data product ID
character sting for name of the data table to download, e.g., 'sls_soilCoreCollection'
list of sites, domains, etc. If NA, retrieve all data for the given data table / dpid combination.
character sting for location type, such as 'siteID'. Must be one of the NEON controlled terms. If you're unsure, use 'siteID'
start date for query. Default is 1-Jan-2012, and this should capture the earliest NEON data record.
end date for query. Default is current date.
date format. Default/expected format is yyyy-mm-dd
package type, either 'basic' or 'expanded'. If unsure, use 'expanded'
data endpoint for NEON API.
products endpoint for NEON API.
User specific API token (generated within neon.datascience user accounts)
Eric R. Sokol esokol@battelleecology.org
License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007