catr_clear_cache: Clear your 'CatastRo' cache dir

View source: R/cache-utils.R

catr_clear_cacheR Documentation

Clear your CatastRo cache dir

Description

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.

Details

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

Value

Invisible. This function is called for its side effects.

See Also

tools::R_user_dir()

Other cache utilities: catr_set_cache_dir()

Examples


# Don't run this! It modifies your current state
## Not run: 
my_cache <- catr_detect_cache_dir()

# 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)

catr_set_cache_dir(my_cache)
identical(my_cache, catr_detect_cache_dir())

## End(Not run)

CatastRo documentation built on April 27, 2026, 5:07 p.m.