Learn R Programming

REDCapR (version 0.9.3)

validate_for_write: Inspect a data.frame to anticipate problems before writing to a REDCap project.

Description

This set of functions inspect a data.frame to anticipate problems before writing with REDCap's API.

Usage

validate_for_write( d )
validate_no_logical( d )
validate_no_uppercase( d )

Arguments

d
The data.frame containing the dataset used to update the REDCap project. Required.

Value

A data.frame, where each potential violation is a row. The two columns are:
  1. field_name: The name of the data.frame that might cause problems during the upload.
  2. field_index: The position of the field. (For example, a value of '1' indicates the first column, while a '3' indicates the third column.)
  3. concern: A description of the problem potentially caused by the field.
  4. suggestion: A potential solution to the concern.

Details

All functions listed in the Usage section above inspect a specific aspect of the dataset. The validate_for_read() function executes all these individual validation checks. It allows the client to check everything with one call.

References

The official documentation can be found on the `API Help Page` and `API Examples' pages on the REDCap wiki (ie, https://iwg.devguard.com/trac/redcap/wiki/ApiDocumentation and https://iwg.devguard.com/trac/redcap/wiki/ApiExamples). If you do not have an account for the wiki, please ask your campus REDCap administrator to send you the static material.

Examples

Run this code
d <- data.frame(
  record_id = 1:4,
  flag_logical = c(TRUE, TRUE, FALSE, TRUE),
  flag_Uppercase = c(4, 6, 8, 2)
)
validate_for_write(d = d)

Run the code above in your browser using DataLab