set_data_labels: Set Data Labels

Description Usage Arguments Value Examples

View source: R/label-utils.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)

cchsflow documentation built on June 24, 2021, 1:07 a.m.