Learn R Programming

edgemodelr (version 0.2.0)

edge_clean_cache: Clean up cache directory and manage storage

Description

Remove outdated model files from the cache directory to comply with CRAN policies about actively managing cached content and keeping sizes small.

Usage

edge_clean_cache(
  cache_dir = NULL,
  max_age_days = getOption("edgemodelr.cache_max_age_days", 30),
  max_size_mb = getOption("edgemodelr.cache_max_size_mb", 5000),
  use_lru = TRUE,
  ask = TRUE,
  verbose = TRUE
)

Value

Invisible list of deleted files

Arguments

cache_dir

Cache directory path (default: user cache directory)

max_age_days

Maximum age of files to keep in days (default: option edgemodelr.cache_max_age_days or 30)

max_size_mb

Maximum total cache size in MB (default: option edgemodelr.cache_max_size_mb or 5000)

use_lru

If TRUE, evict least-recently-used files when size exceeds limit

ask

Whether to ask for user confirmation before deletion (only in interactive sessions)

verbose

Whether to print status messages (default: TRUE)

Examples

Run this code
if (FALSE) {
# Clean cache files older than 30 days
edge_clean_cache()

# Clean cache with custom settings
edge_clean_cache(max_age_days = 7, max_size_mb = 100)
}

Run the code above in your browser using DataLab