prep_add_missing_codes {dataquieR} | R Documentation |
Insert missing codes for NA
s based on rules
Description
Insert missing codes for NA
s based on rules
Usage
prep_add_missing_codes(
resp_vars,
study_data,
meta_data_v2,
item_level = "item_level",
label_col,
rules,
use_value_labels,
overwrite = FALSE,
meta_data = item_level
)
Arguments
resp_vars |
variable list the name of the measurement variables to be
modified, all from |
study_data |
data.frame the data frame that contains the measurements |
meta_data_v2 |
character path to workbook like metadata file, see
|
item_level |
data.frame the data frame that contains metadata attributes of study data |
label_col |
variable attribute the name of the column in the metadata with labels of variables |
rules |
data.frame with the columns:
|
use_value_labels |
logical In rules for factors, use the value labels,
not the codes. Defaults to |
overwrite |
logical Also insert missing codes, if the values are not
|
meta_data |
data.frame old name for |
Value
a list
with the entries:
-
ModifiedStudyData
: Study data withNA
s replaced by theCODE_VALUE
-
ModifiedMetaData
: Metadata having the new codes amended in the columnsJUMP_LIST
orMISSING_LIST
, respectively