
Apply USRDS variable labels to a data frame
Source:R/apply_usrds_varlabels.R
apply_usrds_varlabels.RdAdds descriptive variable labels using Appendix B of the USRDS Researcher's Guide.
Variable labels are applied using the labelled package.
Arguments
- df
A data frame loaded from a USRDS file.
- file_key
Character. The canonical file key (e.g., "PATIENTS").
- verbose
Logical. If TRUE, prints each variable being labeled.
Value
A data frame with variable labels added (invisible via print, viewable via labelled::var_label()).
Examples
if (FALSE) {
df <- load_usrds_file("PATIENTS", var_labels = TRUE)
labelled::var_label(df$CDEATH)
}