REDCapExploreR provides exploratory tools for REDCap projects accessed through the REDCap API. Use it to build structured codebooks, review form completion with record status dashboards, and generate general data quality reports.
Installation
You can install the development version of REDCapExploreR like so:
devtools::install_github("CHOP-CGTInformatics/REDCapExploreR")Core workflows
Store REDCap credentials outside your scripts, then pass them to the build functions:
library(REDCapExploreR)
redcap_uri <- Sys.getenv("REDCAP_URI")
token <- Sys.getenv("REDCAP_TOKEN")
status_data <- build_record_status_data(
redcap_uri = redcap_uri,
token = token
)
plot_record_status(status_data)
codebook <- build_codebook(redcap_uri = redcap_uri, token = token)
quality_report <- build_quality_report(redcap_uri = redcap_uri, token = token)Quality reports include selected checks, thresholds, evaluation date, and package version in quality_report$metadata$settings. Their printed overview also states how many field-row values were eligible for missingness assessment.
The package includes mock_redcap_project, mock_record_status_data, mock_codebook, and mock_quality_report for offline exploration. See Get Started for an overview, the function reference for complete API documentation, and the quality report article for a comprehensive guide to quality report checks, output elements, and assumptions.
Field relationships
A codebook supplies field definitions, expressions, and event/repeat context. Build it once to explore several fields without additional API calls or record exports:
library(REDCapExploreR)
relationships <- field_relationship_summary("weight_kg", mock_codebook)
relationships
#> <REDCap field relationships>
#> Field: weight_kg (follow_up)
#> Upstream: 1 item
#> Downstream: 6 direct items, 1 indirect item
#> Reference occurrences across returned chains: 12
#> Action-tag condition: 1; Calculation: 1; Piping: 4; Field embedding: 1; Default value: 3; Unknown relationship type: 1; Branching logic: 1
#> Interpretation issues: 3 related metadata locations (see issues).
#> Project Coverage: project-wide metadata inspection; see coverage for sources and exclusions.
#> Indirect connections are reference chains, not predictions of value or behavior changes.
#> Project interpretation limits are summarized in coverage.Use relationships$references for original expressions and relationships$issues for related interpretation issues and relationships$coverage for project-wide inspection scope, identical for every field summarized from the same codebook. The viewer uses the same Upstream, Downstream, Summary, and Project Coverage terms and shows all references by default. The bundled codebook includes indirect paths, annotations, and interpretation notes around weight_kg. Request include_diagnostics = TRUE when constructing the report to include Project Diagnostics: interpretation issues across the entire project. Request include_inspection_log = TRUE separately for the exhaustive inspection log, including blank and unavailable locations. View and save with view_field_relationship_summary() and save_field_relationship_summary().
Collaboration
We invite you to give feedback and collaborate with us! If you are familiar with GitHub and R packages, please feel free to submit a pull request. Please do let us know if REDCapExploreR fails for whatever reason with your database and submit a bug report by creating a GitHub issue.
Please note that this project is released with a Contributor Code of Conduct. By participating you agree to abide by its terms.
