
Retrieves data from a REDCap instrument and ensures subject identifiers are propagated across all events
redcap(
instrument_name = NULL,
...,
raw_or_label = "raw",
redcap_event_name = NULL,
batch_size = 1000,
records = NULL,
fields = NULL,
exclude_pii = TRUE,
interview_date = NULL,
date_format = "ymd",
complete = NULL
)
A data frame containing the requested REDCap data
Name of the REDCap instrument
Optional column names to filter for. Only rows with non-missing values in ALL specified columns will be returned. This is useful for filtering data to only include complete cases for specific variables of interest.
Whether to return raw or labeled values
Optional event name filter
Number of records to retrieve per batch
Optional vector of specific record IDs
Optional vector of specific fields
Default TRUE remove all fields marked as identifiable
Optional; can be either: - A date string in various formats (ISO, US, etc.) to filter data up to that date - A boolean TRUE to return only rows with non-NA interview_date values
Default ymd define date format for interview_date
Option boolean TRUE will return only forms marked as complete in REDCap
if (FALSE) {
# Get data from a specific instrument
data <- redcap("demographics")
}
Run the code above in your browser using DataLab