View source: R/docsFileRepositoryMethods.R
fileRepositoryMethods | R Documentation |
These methods enable the user to export, import, or delete entire folders of files from the file repository. These actions may be done recursively to include subfolders as well.
exportFileRepository(
rcon,
folder_id,
dir = getwd(),
dir_create = FALSE,
recursive = FALSE,
...
)
importFileRepository(rcon, dir, folder_id = numeric(0), ...)
deleteFileRepository(rcon, folder_id, recursive = FALSE, ...)
## S3 method for class 'redcapApiConnection'
exportFileRepository(
rcon,
folder_id = numeric(0),
dir = getwd(),
dir_create = FALSE,
recursive = FALSE,
...
)
## S3 method for class 'redcapApiConnection'
importFileRepository(
rcon,
dir,
folder_id = numeric(0),
dag_id = numeric(0),
role_id = numeric(0),
recursive = FALSE,
...
)
## S3 method for class 'redcapApiConnection'
deleteFileRepository(
rcon,
folder_id,
recursive = FALSE,
...,
confirm = c("ask", "no", "yes")
)
rcon |
A |
folder_id |
|
dir |
|
dir_create |
|
dag_id |
|
role_id |
|
recursive |
|
confirm |
|
... |
Arguments to pass to other methods |
deleteFileRepository
will only delete files and cannot
delete folders.
Deleted files will remain in the recycling bin for up to 30 days.
exportFileRepository
returns a data frame with the locations to which
the files were saved on the local system. It has the columns:
directory | The directory in which the file is saved. |
filename | The name of the saved file. |
importFileRepository
returns a data frame with the locations to which
the files were saved on the local system. It has the columns:
directory | The directory in which the file is saved. |
filename | The name of the saved file. |
deleteFileRepository
returns a data frame listing the files that
were deleted from the file repository. It has the columns:
folder_id | The REDCap assigned ID number for the folder. This will be NA for files. |
doc_id | The REDCap assigned ID number for the file. |
name | The filename of the deleted files. |
parent_folder | The folder ID of parent folder. |
exportFileRepository()
: Export multiple files from the File Repository.
importFileRepository()
: Import multiple files to the File Repository.
deleteFileRepository()
: Delete multiple files from the File Repository.
exportFromFileRepository()
,
importToFileRepository()
,
deleteFromFileRepository()
,
exportFileRepositoryListing()
,
createFileRepositoryFolder()
## Not run:
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
save_location <- tempdir()
# Export the top-level file repository folder
exportFileRepository(rcon,
folder_id = numeric(0),
dir = save_location)
# Export the entire repository
exportFileRepository(rcon,
folder_id = numeric(0),
dir = save_location,
recursive = TRUE)
# Export a file repository folder below the top-level
exportFileRepository(rcon,
folder_id = 12345,
dir = save_location)
# Import the files from a folder to the top-level file repository
importFileRepository(rcon,
dir = "path/to/folder")
# Import the files from a folder to sub folder of the file repository
importFileRepository(rcon,
dir = "path/to/folder",
folder_id = 12345)
# Import the files from a folder and assign to a specific
# Data Access Group
importFileRepository(rcon,
dir = "path/to/folder",
dag_id = 789)
# Delete files from the top-level folder of the file repository
deleteFileRepository(rcon,
folder_id = numeric(0))
# Delete all the file sfrom the file repository
deleteFileRepository(rcon,
folder_id = numeric(0),
recursive = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.