decode_heims {heims} | R Documentation |
Decode HEIMS elements
Description
Decode HEIMS elements
Usage
decode_heims(DT, show_progress = FALSE, check_valid = TRUE, selector)
Arguments
DT |
A |
show_progress |
Display the progress of the function (which is likely to be slow on real data). |
check_valid |
Check the variable is valid before decoding. Setting to |
selector |
Original HEIMS names to restrict the decoding to. Other names will be preserved. |
Details
Each variable in DT
is validated according heims_data_dict
before being decoded. Any failure stops the validation.
If DT
has a key, the output will have a key, but set on the decoded columns and
the ordering will most likely change (to reflect the decoded values).
This function will, on the full HEIMS data, take a long time to finish. Typically in the order of 10 minutes for the enrol file.
Value
DT
with the values decoded and the names renamed.
Examples
## Not run:
# (E488 is made up so won't work if validation is attempted.)
decode_heims(dummy_enrol)
## End(Not run)
decode_heims(dummy_enrol, show_progress = TRUE, check_valid = FALSE)