This function takes an extracted table from either extract_demographics()
or extract_timevarying()
and returns the same table having dealt with out
of range values. Currently this will either modify the value to NA, or limit
the value at an appropriate max or min, depending upon the user decision.
clean(tbl = NULL, dq_ref = NULL, action = "NA")
a table extracted from the CC-HIC database
a table with ranges to override the default settings. Must take the following columns:
code_name: string vector with NIHR code name for the data item as it appears in your table.
ranges: the lower and upper bounds of a possible value represented as a string of the form "[lower, upper]"
string vector lengh 1 of "NA" or "limit". Currently this applies the action to all variables in the table.
a table of the same dimensions as tbl
but with outlying values
appropriately cleaned.