redcap_export: Extracts/exports data from redcap (using httr) and converts...

View source: R/redcap.R

redcap_exportR Documentation

Extracts/exports data from redcap (using httr) and converts it to a tibble. API token is collected using R studio api when function is run (Avoids collecting API token in Rhistory).

Description

Extracts/exports data from redcap (using httr) and converts it to a tibble. API token is collected using R studio api when function is run (Avoids collecting API token in Rhistory).

Usage

redcap_export(
  fields = NULL,
  records = NULL,
  redcap_uri = "https://redcap.rn.dk/api/",
  identifier = FALSE,
  ...
)

Arguments

fields

str or vec | Single field or vector of fields to export.

records

num | Single or several records to read. Defaults to ALL.

redcap_uri

str | URL to redcap API. Defaults to RN server.

identifier

bool | Whether or not to include CPR number in export.

...

<dynamic-dots> Extra arguments.

Value

tibble

Examples

# Export BMI and weight for participants 1001 and 1002. Is exported as tibble.
df <- redcap_read(fields = c("bmi", "weight"),
            records = c(1001, 1002))

AndersAskeland/chewr documentation built on Sept. 20, 2023, 10:40 a.m.