zipsByProduct: Get files from NEON API to feed the stackByTable() function

View source: R/zipsByProduct.R

zipsByProductR Documentation

Get files from NEON API to feed the stackByTable() function

Description

Pull files from the NEON API, by data product, in a structure that will allow them to be stacked by the stackByTable() function

Usage

zipsByProduct(
  dpID,
  site = "all",
  startdate = NA,
  enddate = NA,
  package = "basic",
  release = "current",
  timeIndex = "all",
  tabl = "all",
  check.size = TRUE,
  include.provisional = FALSE,
  savepath = NA,
  load = F,
  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.

release

The data release to be downloaded; either 'current' or the name of a release, e.g. 'RELEASE-2021'. 'current' returns the most recent release, as well as provisional data if include.provisional is set to TRUE. To download only provisional data, use release='PROVISIONAL'. Defaults to 'current'.

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.

include.provisional

T or F, should provisional data be included in downloaded files? Defaults to F. See https://www.neonscience.org/data-samples/data-management/data-revisions-releases for details on the difference between provisional and released data.

savepath

The location to save the output files to

load

T or F, are files saved locally or loaded directly? Used silently with loadByProduct(), do not set manually.

token

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

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. timeIndex: NEON sensor data are published at pre-determined averaging intervals, usually 1 and 30 minutes. The default download includes all available data. Download volume can be greatly reduced by downloading only the 30 minute files, if higher frequency data are not needed. Use getTimeIndex() to find the available averaging intervals for each sensor data product.

Value

A folder in the working directory (or in savepath, if specified), containing all zip files meeting query criteria.

Author(s)

Claire Lunch clunch@battelleecology.org

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:
zipsByProduct(dpID="DP1.10026.001", site="all", package="expanded")

## End(Not run)

neonUtilities documentation built on May 29, 2024, 9:24 a.m.