sets labels for passed database, Uses the names of final variables in variable_details/variables_sheet as well as the labels contained in the passed dataframes
set_data_labels(data_to_label, variable_details, variables_sheet = NULL)
data_to_label | newly transformed dataset |
---|---|
variable_details | variable_details.csv |
variables_sheet | variables.csv |
labeled data_to_label
library(cchsflow) library(sjlabelled) bmi2001 <- rec_with_table( cchs2001_p, c( "HWTGHTM", "HWTGWTK", "HWTGBMI_der" ) )#>#>#>#>#>#>#>#>#>#>#> HWTGHTM HWTGWTK HWTGBMI_der #> "" "" ""labeled_combined_data <- set_data_labels(combined_bmi, variable_details, variables) get_label(labeled_combined_data)#> HWTGHTM HWTGWTK HWTGBMI_der #> "Height" "Weight" "Derived BMI"