Learn R Programming

redcapAPI (version 2.7.4)

exportFromFileRepository: Export a File from the File Repository

Description

This method allows you to download a single file stored in the File Repository by providing the file's doc_id number. For options to export multiple files, see exportFileRepository.

Usage

exportFromFileRepository(rcon, doc_id, dir = getwd(), dir_create = FALSE, ...)

# S3 method for redcapApiConnection exportFromFileRepository( rcon, doc_id, dir = getwd(), dir_create = FALSE, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

Returns a data.frame with the directory and filename of the saved file.

Arguments

rcon

redcapApiConnection object.

doc_id

integerish(1). The document ID to be downloaded

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 create = FALSE, an error is thrown.

...

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