| Title: | 'NEON' 'API' Client |
|---|---|
| Description: | 'NEON' 'API' (<http://data.neonscience.org/data-api>) client. Includes methods for interacting with all 'API' routes. |
| Authors: | Scott Chamberlain [aut, cre], Josh Roberti [ctb] |
| Maintainer: | Scott Chamberlain <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1.9313 |
| Built: | 2026-05-26 06:22:52 UTC |
| Source: | https://github.com/ropensci-archive/nneo |
NEON API docs: http://data.neonscience.org/data-api
Curl options follow those in the curl package. Find the curl
options by looking at curl::curl_options(). Pass them
on into any nneo function call.
A user agent string is sent in every request just to let the NEON servers know that the request is coming from R and from this package. No personal info is shared, just the package name and version for nneo and the underlying HTTP packages (crul, curl)
Scott Chamberlain [email protected]
Josh Roberti [email protected]
Data
nneo_data(product_code, site_code, year_month, package = NULL, ...) nneo_file(product_code, site_code, year_month, filename, ...)nneo_data(product_code, site_code, year_month, package = NULL, ...) nneo_file(product_code, site_code, year_month, filename, ...)
product_code |
(character) a product code. required. |
site_code |
(character) a site code. required. |
year_month |
(character) YYYY-MM month to check for files. required. |
package |
(character) Package type to return, basic or expanded. optional. |
... |
named curl options passed on to |
filename |
(character) a file name. optional. |
nneo_data gets files available for a given
product/site/month combination.
nneo_file gets a file, and returns a data.frame
nneo_data returns a list, while nneo_file returns
a tibble/data.frame
## Not run: nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05") nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05") ## with a package nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", package = "basic") nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", package = "expanded") ## with a file name fname <- "NEON.D19.HEAL.DP1.00098.001.003.000.030.RH_30min.2016-05.expanded.20171026T085604Z.csv" nneo_file(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", filename = fname) ## curl options nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", verbose = TRUE) ## End(Not run)## Not run: nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05") nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05") ## with a package nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", package = "basic") nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", package = "expanded") ## with a file name fname <- "NEON.D19.HEAL.DP1.00098.001.003.000.030.RH_30min.2016-05.expanded.20171026T085604Z.csv" nneo_file(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", filename = fname) ## curl options nneo_data(product_code = "DP1.00098.001", site_code = "HEAL", year_month = "2016-05", verbose = TRUE) ## End(Not run)
Locations
nneo_locations(...) nneo_location(x, ...)nneo_locations(...) nneo_location(x, ...)
... |
named curl options passed on to |
x |
(character) a location code name |
a tibble (data.frame)
## Not run: ## list products nneo_locations() ## get a product res <- nneo_location("HARV") res res$locationProperties res$locationChildren ## End(Not run)## Not run: ## list products nneo_locations() ## get a product res <- nneo_location("HARV") res res$locationProperties res$locationChildren ## End(Not run)
Products
nneo_products(...) nneo_product(x, ...)nneo_products(...) nneo_product(x, ...)
... |
named curl options passed on to |
x |
(character) a product code |
nneo_products returns a tibble (data.frame), and
nneo_product returns a list
## Not run: ## list products nneo_products() ## get a product res <- nneo_product("DP3.30018.001") res$productDescription ### get many products ids <- c("DP3.30018.001", "DP4.00001.001", "DP3.30025.001") lapply(ids, nneo_product) ## curl options nneo_product("DP3.30018.001", verbose = TRUE) nneo_product("DP3.30018.001", verbose = TRUE, useragent = "hello world") ## End(Not run)## Not run: ## list products nneo_products() ## get a product res <- nneo_product("DP3.30018.001") res$productDescription ### get many products ids <- c("DP3.30018.001", "DP4.00001.001", "DP3.30025.001") lapply(ids, nneo_product) ## curl options nneo_product("DP3.30018.001", verbose = TRUE) nneo_product("DP3.30018.001", verbose = TRUE, useragent = "hello world") ## End(Not run)
Sites
nneo_sites(...) nneo_site(x, ...)nneo_sites(...) nneo_site(x, ...)
... |
named curl options passed on to |
x |
(character) a site code |
a tibble (data.frame)
## Not run: ## list sites nneo_sites() ## get a site res <- nneo_site("JORN") res$dataProducts res$siteDescription ## End(Not run)## Not run: ## list sites nneo_sites() ## get a site res <- nneo_site("JORN") res$dataProducts res$siteDescription ## End(Not run)
Retrieve related, sensor-based datasets at a given NEON site for a custom time period, merged per measurement level and/or variable
nneo_wrangle(site_code = "CPER", time_start = "2017-06-20", time_end = NULL, data_var = "temperature", time_agr = 30, package = "basic", ...)nneo_wrangle(site_code = "CPER", time_start = "2017-06-20", time_end = NULL, data_var = "temperature", time_agr = 30, package = "basic", ...)
site_code |
(character) a site code. Required. |
time_start |
(character) YYYY-MM-DD start day to check for files. Required if time_end=NULL |
time_end |
(character) YYYY-MM-DD end day to check for files. Required if time_start=NULL |
data_var |
(character) NEON data product(s) to be downloaded. The user may enter a specific, controlled, NEON data product or they may enter a generic term if wanting multiple, similar, NEON data products. For instance, defining data_var as "Photosythetically Active Radiation (Quantum Line)" would satisfy the former, and defining data_var as "Active Radiation" or just "Radiation" would satisfy the latter. Required |
time_agr |
(numeric) Aggregation period, given in minutes, of NEON data
product(s) to be downloaded
(e.g. |
package |
(character) Package type to return, basic or expanded. 'Expanded' datasets are only available for the smallest time_agr of each NEON data product. NOTE: 'expanded' datasets are much larger than 'basic' and will take considerably more time to download. Required |
... |
named curl options passed on to |
Returns a tibble of relevant data products from all spatial locations at a NEON site for the custom time period. Data products are displayed via 'productName.spatialLocation', e.g., 'difRadMean.000.060' is mean, diffuse, shortwave radiation as measured on the 6th measurement level of a NEON tower (000.060), while 'linePARMean.005.000' is mean, photosynthetically Active Radiation (PAR) as measured at the 5th soil plot (005.000) of a NEON site. More information regarding spatial location and identifiers can be found at the references below.
Josh Roberti [email protected]
Dave Durden
Robert Lee
NEON Data Portal
NEON Data Availability
Currently none
## Not run: #download 30-minute, radiation data from NEON's Bartlett site for Summer 2016 nneo_wrangle(site_code="BART", time_start="2016-06-20", time_end="2016-09-21", data_var="radiation") #download 30-minute, temperature data from NEON's Sterling (STER) site for 2017-03-04 nneo_wrangle(site_code="STER",time_start="2017-03-04", data_var="temperature",time_agr=30) ## End(Not run)## Not run: #download 30-minute, radiation data from NEON's Bartlett site for Summer 2016 nneo_wrangle(site_code="BART", time_start="2016-06-20", time_end="2016-09-21", data_var="radiation") #download 30-minute, temperature data from NEON's Sterling (STER) site for 2017-03-04 nneo_wrangle(site_code="STER",time_start="2017-03-04", data_var="temperature",time_agr=30) ## End(Not run)