rc_read_api: Read in record and metadata from REDCap using redcapAPI

View source: R/tidy_redcap.R

rc_read_apiR Documentation

Read in record and metadata from REDCap using redcapAPI

Description

A wrapper for importing data Records, data dictionary, events, and instrument designation mappings from REDCap. Uses the redcapAPI package.

Usage

rc_read_api(
  url,
  token,
  labels = FALSE,
  cast = list(system = redcapAPI::castRaw, date_ = as.Date, yesno = function(x, ...) x ==
    "1" | tolower(x) == "yes", checkbox = function(x, ...)
    as.logical(redcapAPI::castRaw(x, ...)))
)

Arguments

url

URL for a REDCap database API. Check your institution's REDCap documentation for this address.

token

REDCap API token

labels

Passed to 'redcapAPI::exportRecordsTyped', determines if the variable labels are applied to the data frame. 'FALSE' by default.

cast

Passed to 'redcapAPI::exportRecordsTyped', determines how different types of fields are returned. By default, all checkbox and yesno fields are returned as logical.

Value

A named list containing four dataframes: dd = metadata, evnt = Events, inst = Instrument mappings, rcrd = Records.


jwilliman/redcapTidy documentation built on June 1, 2024, 2:24 a.m.