Skip to contents

Use this function with caution. This function clears your cached data and configuration, specifically:

  • Deletes the giscoR config directory (tools::R_user_dir("giscoR", "config")).

  • Deletes the cache_dir directory.

  • Deletes the values stored on Sys.getenv("GISCO_CACHE_DIR").

Usage

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

Arguments

config

If TRUE, delete the configuration folder of giscoR.

cached_data

If TRUE, delete your cache_dir and all its content.

verbose

A logical value. If TRUE displays informational messages.

Value

Invisible. This function is called for its side effects.

Details

This function fully resets your status as if you had never installed or used giscoR.

See also

Examples


# Do not run this. It modifies your current state.
# \dontrun{
my_cache <- gisco_detect_cache_dir()
#>  /tmp/RtmpsmC0dv/giscoR

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

# Restore initial cache
gisco_clear_cache(verbose = TRUE)
#> ! giscoR data deleted: /tmp/RtmpsmC0dv/example/cache (0 bytes).

gisco_set_cache_dir(my_cache)
#>  giscoR cache dir is /tmp/RtmpsmC0dv/giscoR.
#>  To install your `cache_dir` path for use in future sessions run this function with `install = TRUE`.
identical(my_cache, gisco_detect_cache_dir())
#>  /tmp/RtmpsmC0dv/giscoR
#> [1] TRUE
# }