View source: R/make_data_release.R
make_data_release | R Documentation |
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.
make_data_release(
metadata,
package,
destdir = getwd(),
...,
bounding = NULL,
rngdates = NULL,
validate = FALSE
)
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 |
bounding |
'bbox', 'sf', 'SpatRaster', or 'PackedSpatRaster' spatial feature.
Object to compute spatial bounding coordinates from, see |
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 |
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.
Named list of metadata created for spatial and non-spatial datasets.
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
A.R. Trcka, U.S. Geological Survey, Idaho Water Science Center
parse_rd_db
function for reading and parsing R-package documentation.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.