Downloads and returns the variable dictionary for PNADC microdata. The dictionary is cached locally to avoid repeated downloads.
Arguments
- module
Character. The module identifier (e.g., "deficiencia", "habitacao").
- year
Numeric. Year to get dictionary for. Uses most recent year if NULL.
- cache_dir
Character. Directory for caching downloaded files. Default uses
tools::R_user_dir("healthbR", "cache").- refresh
Logical. If TRUE, re-download even if file exists in cache. Default is FALSE.
Details
The dictionary includes variable names, positions, and widths from the
IBGE input specification file. This is useful for understanding the structure
of the data returned by pnadc_data.
Examples
if (FALSE) { # interactive()
# get dictionary for deficiencia module
dict <- pnadc_dictionaries(module = "deficiencia", cache_dir = tempdir())
}