Skip to contents

Exports specified records from the REDCap database (`DB` object) to the specified directory.

Usage

drop_REDCap_to_directory(
  DB,
  records,
  smart = T,
  deidentify = F,
  include_metadata = T,
  include_other = T,
  with_links = T,
  forms,
  merge_non_repeating = T,
  separate = F,
  str_trunc_length = 32000,
  file_name,
  dir_other
)

Arguments

DB

A validated `DB` object containing REDCap project data and settings. Generated using load_DB or setup_DB

records

Character vector of records you want dropped to your directory.

smart

Logical (TRUE/FALSE). If TRUE, only saves when data is new. Default is `TRUE`.

deidentify

Logical (TRUE/FALSE). If TRUE, deidentifies the data. Default is `FALSE`.

include_metadata

Logical (TRUE/FALSE). If TRUE, includes metadata in the export. Default is `TRUE`.

include_other

Logical (TRUE/FALSE). If TRUE, includes other data in the export. Default is `TRUE`.

Optional logical (TRUE/FALSE) for including links in Excel sheets. Default is `FALSE`.

forms

Optional character vector for selecting specific forms to export.

merge_non_repeating

Optional logical (TRUE/FALSE) for merging non-repeating instruments. Default is `FALSE`.

separate

Optional logical (TRUE/FALSE) separating each form into separate files as opposed to multi-tab Excel. Default is `FALSE`.

str_trunc_length

Optional integer for truncation of strings.

file_name

Optional character string for adding to the front of file names.

dir_other

Optional character string a different folder than DB$dir_path.

Value

Messages for confirmation.

Details

This function exports the specified records from the REDCap database to the specified directory. It supports various options such as deidentification, including metadata, and merging non-repeating instruments. The function can also save the data only when it is new, and it allows for customization of file names and truncation of strings.

See also

setup_DB for initializing the `DB` object.