Package: REDCapR 1.6.0.9001

Will Beasley

REDCapR: Interaction Between R and REDCap

Encapsulates functions to streamline calls from R to the REDCap API. REDCap (Research Electronic Data CAPture) is a web application for building and managing online surveys and databases developed at Vanderbilt University. The Application Programming Interface (API) offers an avenue to access and modify data programmatically, improving the capacity for literate and reproducible programming.

Authors:Will Beasley [aut, cre], David Bard [ctb], Thomas Wilson [ctb], John J Aponte [ctb], Rollie Parrish [ctb], Benjamin Nutter [ctb], Andrew Peters [ctb], Hao Zhu [ctb], Janosch Linkersdörfer [ctb], Jonathan Mang [ctb], Felix Torres [ctb], Philip Chase [ctb], Victor Castro [ctb], Greg Botwin [ctb], Stephan Kadauke [ctb], Ezra Porter [ctb], Matthew Schuelke [ctb]

REDCapR_1.6.0.9001.tar.gz
REDCapR_1.6.0.9001.zip(r-4.7)REDCapR_1.6.0.9001.zip(r-4.6)REDCapR_1.6.0.9001.zip(r-4.5)
REDCapR_1.6.0.9001.tgz(r-4.6-any)REDCapR_1.6.0.9001.tgz(r-4.5-any)
REDCapR_1.6.0.9001.tar.gz(r-4.7-any)REDCapR_1.6.0.9001.tar.gz(r-4.6-any)
REDCapR_1.6.0.9001.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
REDCapR/json (API)

# Install 'REDCapR' in R:
install.packages('REDCapR', repos = c('https://ouhscbbmc.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ouhscbbmc/redcapr/issues

Pkgdown/docs site:https://ouhscbbmc.github.io

On CRAN:

Conda:

redcapredcap-api

12.35 score 135 stars 7 packages 552 scripts 1.8k downloads 50 exports 39 dependencies

Last updated from:c2abbc19f4. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK159
source / vignettesOK228
linux-release-x86_64OK175
macos-release-arm64OK105
macos-oldrel-arm64OK100
windows-develOK114
windows-releaseOK117
windows-oldrelOK105
wasm-releaseOK154

Exports:checkbox_choicesconstantconstant_to_accessconstant_to_export_rightsconstant_to_form_completionconstant_to_form_rightscreate_batch_glossarycreate_credential_localredcap_arm_exportredcap_column_sanitizeredcap_dag_readredcap_deleteredcap_download_file_oneshotredcap_download_instrumentredcap_event_instrumentsredcap_event_readredcap_file_download_oneshotredcap_file_repo_list_oneshotredcap_file_upload_oneshotredcap_instrument_downloadredcap_instrument_repeatingredcap_instrumentsredcap_log_readredcap_metadata_coltypesredcap_metadata_readredcap_metadata_writeredcap_next_free_record_nameredcap_projectredcap_project_info_readredcap_readredcap_read_oneshotredcap_reportredcap_survey_link_export_oneshotredcap_upload_file_oneshotredcap_users_exportredcap_variablesredcap_versionredcap_writeredcap_write_oneshotregex_named_capturesretrieve_credential_localretrieve_credential_mssqlsanitize_tokenvalidate_data_frame_inheritsvalidate_field_namesvalidate_for_writevalidate_no_logicalvalidate_record_id_namevalidate_repeat_instancevalidate_uniqueness

Dependencies:askpassbackportsbitbit64checkmateclicliprcpp11crayoncurldplyrgenericsgluehmshttrjsonlitelifecyclemagrittrmimeopensslpillarpkgconfigprettyunitsprogresspurrrR6readrrlangstringistringrsystibbletidyrtidyselecttzdbutf8vctrsvroomwithr

Troubleshooting REDCap API Calls
Language Agnostic | Server Configuration and Authorization | Reading | Writing | Common Gotchas | R | Reading without a Package | Reading with the REDCapR Package | Reading with the redcapAPI Package | General Information | Troubleshooting Strategies | Resources | Document Info

Last update: 2026-02-16
Started: 2014-07-02

Retrieving Longitudinal and Repeating Structures
Background | Illustration of How Data Points are Structured | Possible Table Structures | Table 1: patient grain | Table 2: observation grain for intake instrument | Table 3a: patient-time grain for blood_pressure instrument | Table 3b: patient-time grain for laboratory instrument | Table 4: observation grain for intake, blood_pressure, and laboratory instruments | Table 5: mishmashed grain | Terminology | observation | Retrieving from REDCap | One REDCapR Call for Each Table | Retrieve patient-level table (corresponding to Table 1) | Retrieve patient-time-level tables (corresponding to Tables 3a & 3b) | Retrieve block tables (corresponding to Table 5) | One REDCapTidieR Call for All Tables | Choosing between the Approaches | Escalating to REDCapR | Advanced | Longitudinal | Caching Results to Improve Performance | Caching Results for other Languages | Session Information

Last update: 2026-02-12
Started: 2022-09-29

Typical REDCap Workflow for a Data Analyst
Part 1 - Pre-requisites | Verify REDCapR is installed | Verify REDCap Access | Review Codebook | Part 2 - Retrieve Protected Token | Security Method 1: Token File | Security Method 2: Token Server | Part 3 - Read Data: Unstructured Approach | Part 4 - Read Data: Choosing Columns and Rows | Specify Record IDs | Specify Row Filter | Specify Column Names | Part 5 - Read Data: Structured Approach | Specify Column Names & Types | Specify Everything is a Character | Part 6 - Next Steps | Other REDCapR Resources | Create an Arch for Reuse | Downstream Reproducible Reports | Batching | Writing to the Server | Notes | Session Information

Last update: 2026-02-12
Started: 2021-07-09

Writing to a REDCap Project
Part 1 - Intro | Strategy | Pre-requisites | Retrieve Token | Datasets to Write to Server | Part 2 - Write Data: One row per patient | Prep: Stoplight Fields | Prep: REDCapR::validate_for_write() | Prep: Write Small Subset First | Prep: Recode Variables where Necessary | Write Entire Patient-level Table | Part 3 - Write Data: Repeating Instrument | Add Plumbing Variables | Writing Repeating Instrument Variables | Part 4 - Next Steps | More Complexity | Batching | Manual vs API | REDCap's CDIS | Notes | Session Information

Last update: 2026-02-12
Started: 2023-06-04

Advanced REDCapR Operations
Next Steps | Set project-wide values | Converting from tall/long to wide | Query the Underlying MySQL Database | SSL Options | Convert SPSS Output to REDCap data dictionary | Session Information

Last update: 2025-01-11
Started: 2017-03-29

Basic REDCapR Operations
Reading REDCap Data | Set project-wide values | Read all records and fields | Read a subset of the records | Read a subset of the fields | Read a subset of records, conditioned on the values in some variables | Additional Returned Information | Session Information

Last update: 2025-01-11
Started: 2013-11-29

Security Database
Description | Create a DSN on each client | Note | Create Database | Create user credentials to the auxiliary database | Transfer Credentials | Document Info

Last update: 2025-01-11
Started: 2014-09-08

Readme and manuals

Help Manual

Help pageTopics
Collapse a vector of values into a single string when necessarycollapse_vector
Collection of REDCap-specific constantsconstant constant_to_access constant_to_export_rights constant_to_form_completion constant_to_form_rights
Creates a dataset that help batching long-running read and writescreate_batch_glossary
REDCapR internal function for calling the REDCap APIkernel_api
Manipulate and interpret the metadata of a REDCap projectcheckbox_choices metadata_utilities regex_named_captures
Export Armsredcap_arm_export
Sanitize to adhere to REDCap character encoding requirementsredcap_column_sanitize
Read data access groups from a REDCap projectredcap_dag_read
Delete records in a REDCap projectredcap_delete
Enumerate the instruments to event mappingsredcap_event_instruments
Export Eventsredcap_event_read
Download a file from a REDCap project recordredcap_download_file_oneshot redcap_file_download_oneshot
Export a List of Files/Folders from the File Repositoryredcap_file_repo_list_oneshot
Upload a file into to a REDCap project recordredcap_file_upload_oneshot redcap_upload_file_oneshot
Download REDCap Instrumentsredcap_download_instrument redcap_instrument_download
Enumerate repeating instruments and eventsredcap_instrument_repeating
Enumerate the instruments (forms)redcap_instruments
Get the logging of a project.redcap_log_read
Suggests a col_type for each field in a REDCap projectredcap_metadata_coltypes
Export the metadata of a REDCap projectredcap_metadata_read
Import metadata of a REDCap projectredcap_metadata_write
Determine free available record IDredcap_next_free_record_name
A Reference Class to make later calls to REDCap more convenientredcap_project
Export project information.redcap_project_info_read
Read records from a REDCap project in subsets, and stacks them together before returning a datasetredcap_read
Read/Export records from a REDCap project, returned as eavredcap_read_eav_oneshot
Read/Export records from a REDCap projectredcap_read_oneshot
Read/Export records from a REDCap project -still in developmentredcap_read_oneshot_eav
Read/Export records that populate a REDCap reportredcap_report
Get survey link from REDCapredcap_survey_link_export_oneshot
List authorized usersredcap_users_export
Enumerate the exported variablesredcap_variables
Determine version of REDCap instanceredcap_version
Write/Import records to a REDCap projectredcap_write
Write/Import records to a REDCap projectredcap_write_oneshot
Create explicit factor level for missing valuesreplace_nas_with_explicit
Read a token and other credentials from a (non-REDCap) database or filecreate_credential_local retrieve_credential retrieve_credential_local retrieve_credential_mssql
Validate and sanitize the user's REDCap tokensanitize_token
Convert a vector to the array format expected by the REDCap APIto_api_array
Inspect a dataset to anticipate problems before writing to a REDCap projectvalidate validate_data_frame_inherits validate_field_names validate_for_write validate_no_logical validate_record_id_name validate_repeat_instance validate_uniqueness