R/finbif_clear_cache.R

Defines functions finbif_clear_cache

Documented in finbif_clear_cache

#' Clear cache
#'
#' Remove cached API requests from FinBIF.
#'
#' @aliases fb_clear_cache
#'
#' @examples \dontrun{
#'
#' finbif_clear_cache()
#' }
#' @export

finbif_clear_cache <- function() {
  fcp <- getOption("finbif_cache_path")
  if (is.null(fcp)) {
    rm(
      list = ls(all.names = TRUE, envir = cache_location),
      envir = cache_location
    )
  } else {
    stopifnot(identical(unlink(file.path(fcp, "finbif_cache_file_*")), 0L))
    invisible(NULL)
  }
}

Try the finbif package in your browser

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

finbif documentation built on Jan. 3, 2022, 5:09 p.m.