Learn R Programming

neonstore (version 0.2.1)

neon_download_s3: Download requested NEON files from an S3 bucket

Description

Queries the AWS-S3 REST endpoint GET bucket for a file list in (in 1000-file chunks), then filters file names to determine what to download. This should be much faster than the NEON API and avoids rate-limiting.

Usage

neon_download_s3(
  product,
  start_date = NA,
  end_date = NA,
  site = NA,
  type = "expanded",
  file_regex = "[.]csv",
  quiet = FALSE,
  verify = TRUE,
  dir = neon_dir(),
  unzip = TRUE,
  api = "https://minio.thelio.carlboettiger.info/neonstore/"
)

Arguments

product

A NEON productCode. See neon_download.

start_date

Download only files as recent as (YYYY-MM-DD). Leave as NA to download up to the most recent available data.

end_date

Download only files up to end_date (YYYY-MM-DD). Leave as NA to download all prior data.

site

4-letter site code(s) to filter on. Leave as NA to search all.

type

Should we prefer the basic or expanded version of this product? See details.

file_regex

Download only files matching this pattern. See details.

quiet

Should download progress be displayed?

verify

Should downloaded files be compared against the MD5 hash reported by the NEON API to verify integrity? (default TRUE)

dir

Location where files should be downloaded. By default will use the appropriate applications directory for your system (see rappdirs::user_data_dir). This default also be configured by setting the environmental variable NEONSTORE_HOME, see Sys.setenv or Renviron.

unzip

should we extract .zip files? Also removes the .zip files. (default TRUE). Set to FALSE if you want to keep .zip archives and manually unzip them later.

api

URL to an S3 bucket containing raw NEON data files (in flat file structure like that used by neonstore).

Value

(invisibly) table of requested files and metadata

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# }
# NOT RUN {
 neon_download("DP1.10003.001", 
               start_date = "2018-01-01", 
               end_date = "2019-01-01",
               site = "YELL")
# }
# NOT RUN {
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab