clear_cache_tracts: Delete cached census tract Parquet files

View source: R/clear_cache.R

clear_cache_tractsR Documentation

Delete cached census tract Parquet files

Description

clear_cache_tracts() removes census tract Parquet files stored in the user cache directory by tracts_to_h3() and tracts_to_polygon().

Usage

clear_cache_tracts(uf = "all", verbose = TRUE, cache_dir = NULL, year = NULL)

Arguments

uf

"all", a two-letter UF abbreviation (e.g. "BA"), a two-digit numeric state code (e.g. 29L), or a seven-digit IBGE municipality code (e.g. 2919207). If "all" (default), all cached Parquet files are deleted. Otherwise, only the file for the resolved state is deleted.

verbose

Logical; if TRUE (default), reports the number of files deleted and the space freed.

cache_dir

Character. Directory to use for cached downloads. If NULL (default), the CNEFETOOLS_CACHE_DIR environment variable is used when it is set, otherwise tools::R_user_dir() with which = "cache". Use this to point large downloads at a secondary drive or a shared volume.

year

Integer. Restrict the deletion to one CNEFE edition. NULL (default) clears every edition, which is the previous behaviour.

Value

Invisibly, the character vector of deleted file paths.

Examples


# Delete all cached census tract Parquets
clear_cache_tracts()

# Delete only the Parquet for Bahia (several equivalent calls)
clear_cache_tracts("BA")
clear_cache_tracts(29)
clear_cache_tracts(2919207)  # municipality code → state resolved automatically



cnefetools documentation built on Oct. 2, 2026, 1:08 a.m.