# Convert a single variable
to_label(survey_data$gender)
# Convert specific columns in a data frame
data <- to_label(survey_data, gender, region)
# Convert all labelled columns
data <- to_label(survey_data)
# Keep values without labels as factor levels
to_label(survey_data$life_satisfaction, add_non_labelled = TRUE)
Run the code above in your browser using DataLab