Use this function with caution. It clears your cached data and configuration, specifically:
Deletes the mapSpain configuration directory (
tools::R_user_dir("mapSpain", "config")).Deletes the
cache_dirdirectory and its contents.Clears the value stored in
Sys.getenv("MAPSPAIN_CACHE_DIR").
Arguments
- config
logical. If
TRUE, deletes the configuration folder of mapSpain.- cached_data
logical. If
TRUE, deletes yourcache_dirand all its contents.- verbose
logical. If
TRUEdisplays informational messages.
Details
This is an aggressive function intended to reset your installation as if you had never installed or used mapSpain.
See also
Other cache utilities:
esp_set_cache_dir()
Examples
# Don't run this! It would modify your current state
# \dontrun{
my_cache <- esp_detect_cache_dir()
#> ℹ C:\Users\RUNNER~1\AppData\Local\Temp\Rtmpu6mf0f/mapSpain
# Set an example cache
ex <- file.path(tempdir(), "example", "cache")
esp_set_cache_dir(ex, verbose = FALSE)
# Restore initial cache
esp_clear_cache(verbose = TRUE)
#> ✔ mapSpain data deleted: C:\Users\RUNNER~1\AppData\Local\Temp\Rtmpu6mf0f/example/cache (0 bytes)
esp_set_cache_dir(my_cache)
#> ℹ mapSpain cache dir is C:\Users\RUNNER~1\AppData\Local\Temp\Rtmpu6mf0f/mapSpain.
#> ℹ To install your `cache_dir` path for use in future sessions run this function with `install = TRUE`.
identical(my_cache, esp_detect_cache_dir())
#> ℹ C:\Users\RUNNER~1\AppData\Local\Temp\Rtmpu6mf0f/mapSpain
#> [1] TRUE
# }
