Learn R Programming

redcapAPI (version 2.7.4)

missingSummary: Report of Missing Values

Description

Returns a data frame of subject events with missing values.

Usage

missingSummary(
  rcon,
  excludeMissingForms = TRUE,
  ...,
  fixed_fields = REDCAP_SYSTEM_FIELDS
)

# S3 method for redcapApiConnection missingSummary( rcon, excludeMissingForms = TRUE, ..., fixed_fields = REDCAP_SYSTEM_FIELDS, exportRecordsArgs = list(), error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

missingSummary_offline( records, meta_data, excludeMissingForms = TRUE, fixed_fields = REDCAP_SYSTEM_FIELDS )

Arguments

rcon

A redcapConnection object.

excludeMissingForms

logical(1) If all of the fields in a form are missing, would you like to assume that they are purposefully missing? For instance, if a patient did not experience an adverse event, the adverse event form would contain no data and you would not want it in this report.

...

Additional arguments to pass to other methods. Currently ignored.

fixed_fields

character A vector of field names that will be used as the identifying fields in the output summary. This always includes the record identifier (ie, the first field in the data dictionary). By default it also includes any fields identified in REDCAP_SYSTEM_FIELDS, which are fields that REDCap adds to exports to identify arms, events, etc..

exportRecordsArgs

named list with arguments to pass to exportRecords. This allows for testing specific forms, events, and/or records. Internally, any setting you make for factors, labels, dates, survey, or dag arguments will be ignored.

error_handling

An option for how to handle errors returned by the API. see redcap_error

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

list Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

records

character(1) A filename pointing to the raw records download from REDCap.

meta_data

character(1) A filename pointing to the data dictionary download from REDCap.

Author

Benjamin Nutter

Details

The intention of this function is to generate a list of subject events that are missing and could potentially be values that should have been entered.

The branching logic from the data dictionary is parsed and translated into and R expression. When a field with branching logic passes the logical statement, it is evaluated with is.na, otherwise, it is set to FALSE (non-missing, because there was never an opportunity to provide a value). The utility of this function is limited to simple logic where all of the data exist within the same row. Any complex statements using events will result in a failure.

Optionally, forms that are entirely missing can be determined to be non-missing. This is applicable when, for instance, a patient did not have an adverse event. In this case, a form dedicated to adverse events would contain meaningless missing values and could be excluded from the report.