Given a dataset and its dictionary, build mappings between harmonised names and raw headers, then rename dataset columns accordingly. Matching is case-, space-, punctuation-, and accent-insensitive. Optionally prints CLI diagnostics summarising matched and unmatched columns.
Arguments
- data
a data.frame with DHIS2 columns to be renamed.
- dict
a data.frame containing the dictionary.
- new_col
column in
dictwith harmonised names (name or index).- old_col
column in
dictwith raw/source names (name or index).- verbose
logical; if TRUE (default) prints CLI messages.
- drop_unmatched
logical; if TRUE, drops columns that are not found in the dictionary. Default is FALSE.
