catr_clear_cache: Clear your 'CatastRo' cache directory

View source: R/cache-utils.R

catr_clear_cacheR Documentation

Clear your CatastRo cache directory

Description

Use this function with caution. Depending on its arguments, this function:

  • Deletes the CatastRo configuration directory when config = TRUE (tools::R_user_dir("CatastRo", "config")).

  • Deletes the cache_dir directory and its contents when cached_data = TRUE.

  • Always clears the CATASTROESP_CACHE_DIR environment variable.

Usage

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

Arguments

config

If TRUE, deletes the configuration directory of CatastRo.

cached_data

If TRUE, deletes your cache_dir and all its contents.

verbose

Logical. Whether to display informational messages.

Details

With config = TRUE and cached_data = TRUE, this function resets the cache state as if you had never used CatastRo.

Value

NULL, invisibly. This function is called for its side effects.

See Also

tools::R_user_dir() defines platform-specific user directories.

Manage the local cache: 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 Oct. 5, 2026, 5:07 p.m.