generate_data_validation_code | R Documentation |
This is a utility function that employs code generation to produce R code that validates data entry workflow for errors of omission and commision.
generate_data_validation_code(metadata, date_var, hosp_var, surrogate_id_var, custom_code = NA, updates = NULL, updates_envir_depth = 1, negative_char = "_")
metadata |
REDCap metadata with a formatted branching logic variable f.branching_logic. See |
date_var |
Name of variable that captures the date of entry |
hosp_var |
Name of variable that holds the hospital code |
surrogate_id_var |
Name of variable that holds a surrogate identifier that is easier to reference |
custom_code |
Any code that is appended for custom plugin of special validation checks. |
updates |
Name of a list of RedcapUpdate(s) to be used for plugging functionality that abstracts the introduction of new variables during the projects lifecycle. See |
updates_envir_depth |
Integer of what parent frame contains updates. Default is immediate parent of calling environment (1) ie one level deep. |
negative_char |
checkbox expansion character for a negative checkbox level |
Using the redcap metadata, code is generated that validates data entry during the data capture process.
This code is then evaluated into a function that is then iterated through the records to check for errors during data capture.
The result is a dataset containing the resultant errors.
A function that can be evaluated to validate data entry workflow for a single record.
Other Code Generators: generate_date_conversion_code
,
generate_formatting_code
,
generate_remove_missing_code
,
generate_remove_outliers_code
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.