Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

exportReports

Export Reports from a REDCap Database


Description

Exports reports from a REDCap Database and formats data if requested

Usage

exportReports(
  rcon,
  report_id,
  factors = TRUE,
  labels = TRUE,
  dates = TRUE,
  checkboxLabels = FALSE,
  ...
)

## S3 method for class 'redcapDbConnection'
exportReports(
  rcon,
  report_id,
  factors = TRUE,
  labels = TRUE,
  dates = TRUE,
  checkboxLabels = FALSE,
  ...
)

## S3 method for class 'redcapApiConnection'
exportReports(
  rcon,
  report_id,
  factors = TRUE,
  labels = TRUE,
  dates = TRUE,
  checkboxLabels = FALSE,
  ...,
  bundle = getOption("redcap_bundle"),
  error_handling = getOption("redcap_error_handling")
)

Arguments

rcon

A REDCap connection object as created by redcapConnection.

report_id

Integer. Gives the report id of the desired report. This is located on the Report Builder page of the user interface on REDCap.

factors

Logical. Determines if categorical data from the database is returned as numeric codes or labelled factors.

labels

Logical. Determines if the variable labels are applied to the data frame.

dates

Logical. Determines if date variables are converted to POSIXlt format during the download.

checkboxLabels

Logical. Determines the format of labels in checkbox variables. If FALSE labels are applies as "Unchecked"/"Checked". If TRUE, they are applied as ""/"[field_labe]" where [field_label] is the label assigned to the level in the data dictionary. This option is only available after REDCap version 6.0.

...

Additional arguments to be passed between methods.

bundle

A redcapBundle object as created by exportBundle.

error_handling

An option for how to handle errors returned by the API. see redcap_error

Details

A record of exports through the API is recorded in the Logging section of the project.

Reports are exported based on their id number, which can be looked up in the Reports page of a project

REDCap API Documentation (6.5.0)

This function allows you to export the data set of a report created on a project's "Data Exports, Reports, and Stats" page.

Note about export rights (6.0.0+): Please be aware that Data Export user rights will be applied to this API request. For example, if you have "No Access" data export rights in the project, then the API report export will fail and return an error. And if you have "De-Identified" or "Remove all tagged Identifier fields" data export rights, then some data fields *might* be removed and filtered out of the data set returned from the API. To make sure that no data is unnecessarily filtered out of your API request, you should have "Full Data Set" export rights in the project.

REDCap Version

6.0.0+

Known REDCap Limitations

None

Author(s)

Benjamin Nutter


redcapAPI

Interface to 'REDCap'

v2.3
GPL-2
Authors
Benjamin Nutter [aut, ctb, cre], Stephen Lane [ctb], Will Beasley [ctb], Jeffrey Horner [ctb], Will Gray [ctb], Jeremy Stephens [ctb], Marcus Lehr [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.