make_data_release {inldata}R Documentation

Create Data Release

Description

Create U.S. Geological Survey (USGS) data release product from R-package datasets and their documentation. Requires that the xml2 and jsonlite packages are available.

Usage

make_data_release(
  metadata,
  package,
  destdir = getwd(),
  ...,
  bounding = NULL,
  rngdates = NULL,
  validate = FALSE
)

Arguments

metadata

'character' string or named 'list'. Either the path to a JSON formatted metadata file that contains general information for the USGS data release (see Examples section), or a named list with the equivalent information.

package

'character' string. Name of a package.

destdir

'character' string. Destination directory to write files, with tilde-expansion performed.

...

Additional arguments to be passed to the write_datasets function. The formats argument, which is specified within the function, is the exception.

bounding

'bbox', 'sf', 'SpatRaster', or 'PackedSpatRaster' spatial feature. Object to compute spatial bounding coordinates from, see sf::st_bbox function.

rngdates

'Date' or 'POSIXct' vector. Object to compute the date range of observations from.

validate

'logical' flag. Whether to perform a metadata validation and stop execution if errors are found. See validate_metadata function for system requirements.

Details

Citation entries for the R package (software release) and accompanying data release should be included in the package CITATION file, and documented in that order.

Value

Named list of metadata created for spatial and non-spatial datasets.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

A.R. Trcka, U.S. Geological Survey, Idaho Water Science Center

See Also

parse_rd_db function for reading and parsing R-package documentation.

Examples

destdir <- tempfile("")
rngdates <- c(samples$sample_dt, gwl$lev_dt) |> range()
l <- make_data_release(
  metadata = system.file("extdata/metadata.json", package = "inldata"),
  package = "inldata",
  destdir = destdir,
  include = "crs",
  quiet = TRUE,
  bounding = sites,
  rngdates = rngdates
)
str(l, 1)

unlink(destdir, recursive = TRUE)

[Package inldata version 1.2.5 Index]