if (FALSE) {
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)
}
Run the code above in your browser using DataLab