Loads a file from the SRTR dataset registry and optionally applies:
Factor labels using the
formats
datasetVariable labels using the
dictionary
dataset
Usage
load_srtr_file(
file_key,
trr_id_filter = NULL,
factor_labels = TRUE,
var_labels = TRUE,
col_select = NULL,
...
)
Arguments
- file_key
Character. Canonical dataset key (e.g., "TX_LI", "CAND_KIPA").
- trr_id_filter
Optional vector of TRR_IDs to keep.. If not NULL, will filter by `TRR_ID' vector passed to this option.
- factor_labels
Logical. Whether to apply factor labels. Default = TRUE.
- var_labels
Logical. Whether to apply variable labels. Default = FALSE.
- col_select
Optional. Tidyselect expression or character vector for selecting columns.
- ...
Additional arguments passed to the file reader (e.g.,
as_factor
forread_sas()
).
Value
A tibble with the loaded file contents, optionally labeled.
The tibble includes attributes source_path
and file_key
.