REDCap (Research Data Capture) developed at Vanderbilt University Medical Center is a widely used web-hosted research data capture and reporting tool for web data and mobile devide data entry. It is build for tightly designed and quality-controlled experiments as well as for observational surveys. REDCap stores metadata that are useful to statistical analysis systems, and the system exports data manually to
SAS and other systems and through an API that is used by many R users, using the redcapAPI , REDCapR, and REDCapExporter packages. This topic focuses on
redcapAPI since it was developed at Vanderbilt and the team supporting it regularly engages with the
REDCap development team.
redcapAPI R package works closely with another R package developed at Vanderbilt,
rccola which is used to safely manage user authentication for live
REDCap interaction through an API.
This topic is intended to help R users develop best practices for working with data from
REDCap, and to have discussions and deal with questions about R programming for working with
REDCap. It is also intended to lead to a “meta” R package that encompasses these best practices.
Managing a project that involves REDCap with analysis in R is mostly ad-hoc. We would like to bring together best practices, and pull together resources / scripts to create a much smoother workflow, which eventually will become a CRAN package.
Outline of functions needed:
Creation- given a specification create all forms in REDCap database Update- given a specification update a REDCap database to match the new specification Export- given a REDCap API key, return a structure that can be used by Creation and Update
Quality Control - Given a REDCap API Key provide a markdown report of possible issues.
Missing Translation Missing Suffix HTML in variable Name Test / Production mismatches (see 1c above) Dropdowns with no entries .... (Need a lot of help-- anyone with scripts to detect problems, please share)
An `rccola` compatible interface with proper labeling/ cleanup.
This is the basic outline. We are looking for top level discussion proposed purpose and any low level useful details that fit inside this scope, and pointers to other R resources related to
- redcapAPI package
- rccola package
- Automatic cleaning up datasets after manual
REDCapexport to R using the
importREDCapfunction: R Workflow
- Automatic reformatting of data tables (e.g., to recombine multiple choices back into one variable as it originally appeared on a case report form) using the
cleanupREDCapfunction, and structuring data tables when the project has a mixture of longitudinal and baseline-only forms: R Workflow
- Using an external file (possibly version controlled in
Github) and the
runDeriveExprfunction to specify post-import derived variable formulas and metadata: R Workflow
- Saving imported datasets for fast retrieval