R/meteo_cache.r

Defines functions meteo_show_cache meteo_clear_cache

Documented in meteo_clear_cache meteo_show_cache

#' Clear *meteo* cached files
#'
#' The *meteo* functions use an aplication
#'
#' @note This function will clear all cached *meteo* files.
#' @param force (logical) force delete. default: `FALSE`
#' @family meteo
#' @export
meteo_clear_cache <- function(force = FALSE) {
  files <- list.files(ghcnd_cache$cache_path_get(), full.names = TRUE)
  unlink(files, recursive = TRUE, force = force)
}

#' Show the *meteo* cache directory
#'
#' Displays the full path to the `meteo` cache directory
#'
#' @family meteo
#' @export
meteo_show_cache <- function() {
  cat(ghcnd_cache$cache_path_get(), "\n")
}

Try the rnoaa package in your browser

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

rnoaa documentation built on May 19, 2021, 9:13 a.m.