exportFileRepositoryListing: Export a Listing of Folders and Files in the File Repository

View source: R/exportFileRepositoryListing.R

exportFileRepositoryListingR Documentation

Export a Listing of Folders and Files in the File Repository

Description

This method enables the user to export a list of folders and files saved to the File Repository. The listing may optionally include contents of subfolders.

Usage

exportFileRepositoryListing(
  rcon,
  folder_id = numeric(0),
  recursive = FALSE,
  ...
)

## S3 method for class 'redcapApiConnection'
exportFileRepositoryListing(
  rcon,
  folder_id = numeric(0),
  recursive = FALSE,
  ...
)

Arguments

rcon

A redcapConnection object.

folder_id

integerish(0/1). The folder ID of a specific folder in the File Repository for which a list of files and subfolders will be exported. By default, the top-level directory of the File Repository will be used.

recursive

logical(1). When TRUE, content of subfolders will be retrieved until a full listing is produced. If FALSE, only the contents of the requested folder will be returned.

...

Arguments to pass to other methods

Value

Returns a data frame with the columns

folder_id The REDCap assigned ID value for the folder. Will be NA if the item is a file.
doc_id The REDCap assigned ID value for the file. Will be NA if the item is a folder.
name The name of the folder of file.
parent_folder The ID of the parent folder of the item. The top-level folder is represented as 0.

See Also

exportFromFileRepository(),
importToFileRepository(),
deleteFromFileRepository(),
exportFileRepository(),
importFileRepository(),
deleteFileRepository(),
createFileRepositoryFolder()

Examples

## Not run: 
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
# Export the top-level listing of the File Repository
exportFileRepositoryListing(rcon)

# Export the complete listing of the File Repository
exportFileRepositoryListing(rcon, 
                            recursive = TRUE)
                            
# Export the listing of a subfolder in the File Repository
exportFileRepositoryListing(rcon, 
                            folder_id = 12345)

## End(Not run)


redcapAPI documentation built on Oct. 17, 2024, 5:07 p.m.