NEON products consist of several individual components, which are in turn broken up by site and sampling month. By storing these individual files, neonstore enables more reproducible workflows that can be traced back to original, unaltered input data. These atomized files can be quickly and easily combined into unified tables, see neon_read.

neon_index(
  product = NA,
  table = NA,
  site = NA,
  start_date = NA,
  end_date = NA,
  type = NA,
  ext = NA,
  timestamp = NA,
  release = NA,
  hash = NULL,
  dir = neon_dir(),
  deprecated = TRUE
)

Arguments

product

A NEON productCode or list of product codes, see examples.

table

Include only files matching this table name (or regex pattern). (optional).

site

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

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.

type

Should we prefer the basic or expanded version of this product? Note that not all products have expanded formats.

ext

only match files with this file extension(s)

timestamp

only match timestamps prior this. See details in neon_index(). Should be a datetime POSIXct object (or coerce-able string)

release

Select only data files associated with a particular release tag, see https://www.neonscience.org/data-samples/data-management/data-revisions-releases, e.g. "RELEASE-2021". Releases are associated with a specific DOI and the promise that files associated with a particular release will not change.

hash

name of a hashing algorithm to check file integrity. Can be "md5", "sha1", or "sha256" currently; or set to NULL (default) to skip hash computation.

dir

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

deprecated

Should the index include files that have since been deprecated by more recent downloads? logical, default TRUE.

Details

File names include metadata such as the file productCode, table name, site, and sampling month, as well as timestamp of creation. neon_index() parses this metadata from the file name string and returns the information in a convenient table, along with a path to each file.

Regarding timestamps: NEON will occasionally publish new versions of previously-released raw data files (which may or may not actually differ). The NEON download API, and hence neon_download(), only serve the most recent of such files, but earlier versions may still exist in your local neonstore if you downloaded them before the updated files were released. By default, neon_read() will always select the most recent of such files, thus avoiding duplication and providing the most updated data. For reproducibility however, it may be necessary to access older version instead. Setting the timestamp argument allows the user to filter out newer files and select the original ones instead. Unfortunately, at this time users cannot request the outdated data files from NEON API. For strict reproducibility, users should also archive their local store.

See also

Examples


# \dontshow{
# Hide setting tempfile, since a user would specify a persistent location
 Sys.setenv("NEONSTORE_HOME"=tempfile())
# }

neon_index()
#> NULL

## Just bird survey product
neon_index("DP1.10003.001")
#> NULL

# \dontshow{
# tidy
 Sys.unsetenv("NEONSTORE_HOME")
# }