Skip to contents

Reads the YAML variable map and delegates each lookup-table construction to a focused internal helper. Returns a single config list that is passed to all other pipeline functions.

Usage

load_config(config_file = "config/variable_map.yml")

Arguments

config_file

Path to the YAML variable map file.

Value

A named list:

name_lookup

Named character vector: alias -> canonical.

label_lookup

Named list: canonical -> label string.

keyword_patterns

Named list: canonical -> regex string.

recode_map

Named list of data.tables: raw -> new value.

value_map

Named list of data.tables: integer code / label.

missing_map

Named list of numeric vectors: codes treated as NA.

type_map

Named character vector: canonical -> R type.

var_map

The raw parsed YAML list (for downstream reference).

Examples

yml <- system.file("extdata", "variable_map.yml", package = "cuci")
config <- load_config(yml)
names(config$type_map)
#> [1] "kjonn"       "alder"       "yrkesstatus" "siv"         "antpers"    
#> [6] "tob1"