set_data_labels {cchsflow} | R Documentation |
Set Data Labels
Description
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
Usage
set_data_labels(data_to_label, variable_details, variables_sheet = NULL)
Arguments
data_to_label |
newly transformed dataset |
variable_details |
variable_details.csv |
variables_sheet |
variables.csv |
Value
labeled data_to_label
Examples
library(cchsflow)
library(sjlabelled)
bmi2001 <- rec_with_table(
cchs2001_p, c(
"HWTGHTM",
"HWTGWTK", "HWTGBMI_der"
)
)
bmi2003 <- rec_with_table(
cchs2003_p, c(
"HWTGHTM",
"HWTGWTK", "HWTGBMI_der"
)
)
combined_bmi <- bind_rows(bmi2001, bmi2003)
get_label(combined_bmi)
labeled_combined_data <- set_data_labels(combined_bmi,
variable_details,
variables)
get_label(labeled_combined_data)
[Package cchsflow version 2.1.0 Index]