Remove old boundary files from the cache to free up disk space.

clean_boundary_cache(
  keep_latest_n = 1,
  older_than_days = NULL,
  territorial_level = "all",
  dry_run = FALSE,
  verbose = TRUE
)

Arguments

keep_latest_n

Integer. Keep this many most recent versions for each territorial level. Default is 1 (keep only latest).

older_than_days

Integer. Remove versions older than this many days. If NULL (default), only keep_latest_n is used.

territorial_level

Character. Clean specific territorial level or "all" (default).

dry_run

Logical. If TRUE, show what would be removed without actually removing. Default is FALSE.

verbose

Logical. Print progress messages? Default is TRUE.

Value

A character vector of removed file paths (invisibly).

Examples

if (FALSE) { # \dontrun{
# Preview what would be removed (dry run)
clean_boundary_cache(dry_run = TRUE)

# Keep only the latest version of each territorial level
clean_boundary_cache(keep_latest_n = 1)

# Remove versions older than 365 days
clean_boundary_cache(older_than_days = 365, keep_latest_n = NULL)

# Clean only municipalities
clean_boundary_cache(
  territorial_level = "comuni",
  keep_latest_n = 2
)
} # }