R/utils.R

Defines functions memory disk

Documented in disk memory

#' Options for saving ERDDAP datasets.
#'
#' @export
#' @param path Path to store files in. A directory, not a file.
#' Default: the root cache path, see \code{\link{cache_setup}}
#' @param overwrite (logical) Overwrite an existing file of the same name?
#' Default: \code{TRUE}
disk <- function(path = NULL, overwrite = TRUE) {
  if (is.null(path)) {
    # path is NULL - use cache path already setup
    path <- rrcache$cache_path_get()
  }
  list(store = "disk", path = path, overwrite = overwrite)
}

#' @export
#' @rdname disk
memory <- function() list(store = "memory")

Try the rerddap package in your browser

Any scripts or data that you put into this service are public.

rerddap documentation built on Aug. 23, 2023, 9:06 a.m.