util_normalize_value_labels {dataquieR}R Documentation

Convert VALUE_LABELS to separate tables

Description

Convert VALUE_LABELS to separate tables

Usage

util_normalize_value_labels(
  meta_data = "item_level",
  max_value_label_len = getOption("dataquieR.MAX_VALUE_LABEL_LEN",
    dataquieR.MAX_VALUE_LABEL_LEN_default)
)

Arguments

meta_data

data.frame old name for item_level

max_value_label_len

integer maximum length for value labels

Value

data.frame metadata with VALUE_LABEL_TABLE instead of VALUE_LABELS (or none of these, if absent)

Examples

## Not run: 
prep_purge_data_frame_cache()
prep_load_workbook_like_file("meta_data_v2")
util_normalize_value_labels()
prep_add_data_frames(test_labs =
  tibble::tribble(~ CODE_VALUE, ~ CODE_LABEL, 17L, "Test", 19L, "Test",
    17L, "TestX"))
il <- prep_get_data_frame("item_level")
if (!VALUE_LABEL_TABLE %in% colnames(il)) {
  il$VALUE_LABEL_TABLE <- NA_character_
}
il$VALUE_LABEL_TABLE[[1]] <- "test_labs"
il$VALUE_LABELS[[1]] <- "17 = TestY"
prep_add_data_frames(item_level = il)
util_normalize_value_labels()

## End(Not run)


[Package dataquieR version 2.5.1 Index]