Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

loadByProduct

Get files from NEON API, stack tables, and load into the current environment


Description

Pull files from the NEON API, by data product, merge data for each table, and read into the current R environment

Usage

loadByProduct(
  dpID,
  site = "all",
  startdate = NA,
  enddate = NA,
  package = "basic",
  timeIndex = "all",
  tabl = "all",
  check.size = TRUE,
  nCores = 1,
  forceParallel = FALSE,
  token = NA_character_,
  avg = NA
)

Arguments

dpID

The identifier of the NEON data product to pull, in the form DPL.PRNUM.REV, e.g. DP1.10023.001

site

Either the string 'all', meaning all available sites, or a character vector of 4-letter NEON site codes, e.g. c('ONAQ','RMNP'). Defaults to all.

startdate

Either NA, meaning all available dates, or a character vector in the form YYYY-MM, e.g. 2017-01. Defaults to NA.

enddate

Either NA, meaning all available dates, or a character vector in the form YYYY-MM, e.g. 2017-01. Defaults to NA.

package

Either 'basic' or 'expanded', indicating which data package to download. Defaults to basic.

timeIndex

Either the string 'all', or the time index of data to download, in minutes. Only applicable to sensor (IS) data. Defaults to 'all'.

tabl

Either the string 'all', or the name of a single data table to download. Defaults to 'all'.

check.size

T or F, should the user approve the total file size before downloading? Defaults to T. When working in batch mode, or other non-interactive workflow, use check.size=F.

nCores

The number of cores to parallelize the stacking procedure. By default it is set to a single core.

forceParallel

If the data volume to be processed does not meet minimum requirements to run in parallel, this overrides. Set to FALSE as default.

token

User specific API token (generated within neon.datascience user accounts)

avg

Deprecated; use timeIndex

Details

All available data meeting the query criteria will be downloaded. Most data products are collected at only a subset of sites, and dates of collection vary. Consult the NEON data portal for sampling details. Dates are specified only to the month because NEON data are provided in monthly packages. Any month included in the search criteria will be included in the download. Start and end date are inclusive.

Value

A named list of all the data tables in the data product downloaded, plus a validation file and a variables file, as available.

Author(s)

References

License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007

Examples

## Not run: 
# To download plant foliar properties data from all sites, expanded data package:
cfc <- loadByProduct(dpID="DP1.10026.001", site="all", package="expanded")

## End(Not run)

neonUtilities

Utilities for Working with NEON Data

v2.0.1
AGPL-3
Authors
Claire Lunch [aut, cre, ctb], Christine Laney [aut, ctb], Nathan Mietkiewicz [aut, ctb], Eric Sokol [aut, ctb], Kaelin Cawley [aut, ctb], NEON (National Ecological Observatory Network) [aut]
Initial release
2021-03-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.