
Step 6 - replace declared numeric missing codes with NA
Source:R/clean_dataset.R
dot-apply_missing_codes.RdOnly replaces integer codes listed in the missing: YAML block. Literal
NA entries in the YAML (written as ~) are ignored here because those
cells are already NA in R.
Arguments
- dt
A data.table (modified by reference).
- config
Config object from
load_config().- cols
Character vector of column names to process.
Details
This step is intentionally opt-in (apply_missing = TRUE in
clean_dataset()) because silently converting plausible integers like 8
or 9 to NA can mask data problems.