Use this function with caution. This function will clear your cached data and configuration, specifically:
Deletes the geobounds config directory (
tools::R_user_dir("geobounds", "config")).Deletes the
cache_dirdirectory.Deletes the values stored in
Sys.getenv("GEOBOUNDS_CACHE_DIR").
Arguments
- config
Logical. If
TRUE, delete the configuration folder of geobounds.- cached_data
Logical. If
TRUE, deletecache_dirand all its contents.- quiet
Logical. If
TRUE, suppress informational messages.
Value
invisible() This function is called for its side effects.
Details
This is a comprehensive reset function that resets your status as if you had never installed or used geobounds.
See also
Other cache utilities:
gb_detect_cache_dir(),
gb_set_cache_dir()
Examples
# Caution! This may modify your current state.
# \dontrun{
my_cache <- gb_detect_cache_dir()
#> ℹ /tmp/RtmplLi8Ac/geobounds
# Set an example cache.
ex <- file.path(tempdir(), "example", "cache")
gb_set_cache_dir(ex, quiet = TRUE)
gb_clear_cache(quiet = FALSE)
#> ! geobounds cached data deleted: /tmp/RtmplLi8Ac/example/cache.
# Restore the initial cache.
gb_set_cache_dir(my_cache)
#> ✔ geobounds cache directory is /tmp/RtmplLi8Ac/geobounds.
#> ℹ To install your `cache_dir` path for use in future sessions run this function with `install = TRUE`.
identical(my_cache, gb_detect_cache_dir())
#> ℹ /tmp/RtmplLi8Ac/geobounds
#> [1] TRUE
# }
