Learn R Programming

redcapAPI (version 2.7.4)

exportFileRepository: Export All Files From a Directory in the File Repository

Description

Exports all of the files in a directory in the File Repository. This is an extension of exportFromFileRepository, which downloads a single file and may be applied recursively to download files in subdirectories as well.

Usage

exportFileRepository(
  rcon,
  folder_id,
  dir = getwd(),
  dir_create = FALSE,
  recursive = FALSE,
  ...
)

# S3 method for redcapApiConnection exportFileRepository( rcon, folder_id = numeric(0), dir = getwd(), dir_create = FALSE, recursive = FALSE, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

Returns a data frame listing the files that were downloaded and the directories in which they are saved.

Arguments

rcon

A redcapConnection object.

folder_id

integerish(0/1) The folder ID with the files to download. If length 0, defaults to the top-level directory.

dir

character(1). A directory on the local system to which the file is to be saved. Defaults to the working directory.

dir_create

logical(1). Create the directory dir if it does not already exist. Defaults to FALSE. If dir does not exist and dir_create = FALSE, an error is thrown.

recursive

logical(1). If TRUE, export all subfolders and their files as well

...

Additional arguments to be passed between methods

error_handling

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

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

list Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

Author

Benjamin Nutter