R/read_proc_format.R
add_proc_format_labels.Rd
Add labels from proc_format file to SAS data file
add_proc_format_labels( df, proc_format, as_factor = FALSE, varname_case = c("lower", "upper"), debug_level = 0, ... )
df | Input data frame read from haven::read_sas |
---|---|
proc_format | Either path to SAS file with |
as_factor | Convert labelled variables to factor with haven::as_factor? |
varname_case | SAS variable names are not case-sensitive, but R variable
names are. Choose one of |
debug_level | Default is |
... | Arguments passed on to
|
Other SAS helper functions:
read_proc_format()
,
read_sas_with_format()
if (FALSE) { bdat <- haven::read_sas("freepsa_data_feb16_d080516.sas7bdat") bdat2 <- add_proc_format_labels(bdat, "freepsa.sas_formats.feb16.d080516.sas") }