esp_clear_cache: Clear your 'mapSpain' cache directory

View source: R/esp-cache.R

esp_clear_cacheR Documentation

Clear your mapSpain cache directory

Description

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_dir directory and its contents.

  • Clears the value stored in Sys.getenv("MAPSPAIN_CACHE_DIR").

Usage

esp_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE)

Arguments

config

Logical. If TRUE, deletes the configuration folder of mapSpain.

cached_data

Logical. If TRUE, deletes your cache_dir and all its contents.

verbose

A logical value indicating whether to display informational messages.

Details

This is an aggressive function intended to reset your installation as if you had never installed or used mapSpain.

Value

Invisible. This function is called for its side effects.

See Also

tools::R_user_dir().

Cache management utilities: esp_set_cache_dir()

Examples


# Do not run this. It would modify your current state.
## Not run: 
my_cache <- esp_detect_cache_dir()

# Set an example cache.
ex <- file.path(tempdir(), "example", "cache")
esp_set_cache_dir(ex, verbose = FALSE)

# Restore the initial cache.
esp_clear_cache(verbose = TRUE)

esp_set_cache_dir(my_cache)
identical(my_cache, esp_detect_cache_dir())

## End(Not run)

mapSpain documentation built on Aug. 31, 2026, 5:07 p.m.