Skip to contents

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

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

  • Deletes the cache_dir directory.

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

Usage

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

Arguments

config

If TRUE, deletes the configuration folder of CatastRo.

cached_data

If TRUE, deletes your cache_dir and all its contents.

verbose

logical. If TRUE displays informational messages.

Value

Invisible. This function is called for its side effects.

Details

This is an overkill function that is intended to reset your status as if you had never installed and/or used CatastRo.

See also

Examples


# Don't run this! It modifies your current state
# \dontrun{
my_cache <- catr_detect_cache_dir()
#>  /tmp/RtmpBJDEem/CatastRo

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

# Restore initial cache
catr_clear_cache(verbose = TRUE)
#> ! CatastRo data deleted: /tmp/RtmpBJDEem/example/cache (0 bytes).

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