Learn R Programming

healthbR (version 0.2.0)

pnadc_dictionaries: Download PNADC variable dictionary

Description

Downloads and returns the variable dictionary for PNADC microdata. The dictionary is cached locally to avoid repeated downloads.

Usage

pnadc_dictionaries(module, year = NULL, cache_dir = NULL, refresh = FALSE)

Value

A tibble with variable definitions.

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.

Data source

Dictionaries are downloaded from the IBGE FTP server.

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

Run this code
if (FALSE) { # interactive()
# get dictionary for deficiencia module
dict <- pnadc_dictionaries(module = "deficiencia", cache_dir = tempdir())
}

Run the code above in your browser using DataLab