rc_missing | R Documentation |
Finds data points which are ostensibly missing from Redcap records data.
For each event/variable combination, if a value exists for at least one
record then it is expected to exist for all records. Any event or variable which is empty within
the entire dataframe will inherently be dropped. If an event has no values for a given record,
none of the variables will be flagged unless there is data for that record in the following event.
Additionally, if the subject is marked as having completed the study (i.e. completion_field
== 'Yes'|1
), then empty events for that subject will not be discarded.
The logic of this function does not extend to repeat instruments or checkbox, calculated, or hidden fields. If present in the record data, they will be dropped. Additionally, this function does not yet support branching logic. Any field with logic dependent on another field will be removed. Fields with other logic, ie event based logic, will remain.
rc_missing(
record_data,
completion_field = NULL,
repeats = NULL,
data_dict = getOption("redcap_bundle")$data_dict,
events = getOption("redcap_bundle")$event_data$unique_event_name,
form_perm = getOption("redcap_bundle")$form_perm,
mappings = getOption("redcap_bundle")$mappings,
id_field = getOption("redcap_bundle")$id_field
)
record_data |
Record data export from REDCap |
completion_field |
Character. The REDCap variable which indicates whether or not a subject has completed the study. This should be indicated by a 'Yes' or a '1' (i.e. a Yes/No field in REDCap). If not provided, some missing data may be lost. |
repeats |
Character. A vector of repeat instrument names which should be kept. This should ONLY be used for repeat instruments which are expected to have a consistent number of occurrences per each event/ID combination. All repeat instruments not supplied here will be removed to avoid excessive false positives. |
data_dict |
Dataframe. REDCap project data data_dictionary. By default,
$data_dict is expected in a REDCap bundle object, as created by |
events |
Character. Vector of REDCap event names. Events not included in this list will not be considered. If supplying manually, chronological ordering of events must be ensured. |
form_perm |
Dataframe. User access permissions for REDCap forms. By default, $form_perm
is expected in the REDCap bundle, as created by |
mappings |
Dataframe. Redcap metadata that maps forms to events. |
id_field |
Character. The name of the record_id field for your REDCap project. |
Marcus Lehr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.