if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
write_to_path <- tempdir()
# Export a file from the repository
exportFromFileRepository(rcon,
doc_id = 12345,
dir = write_to_path)
# Export a file and create the target directory if it does not exist
exportFromFileRepository(rcon,
doc_id = 12345,
dir = write_to_path,
dir_create = TRUE)
# Import a file to the top-level directory of the file repository
importFileToRepository(rcon,
file = "file_to_import.txt")
# Import a file to a specific directory of the file repository
importFileToRepository(rcon,
file = "file_to_import.txt",
folder_id = 678)
# Delete a file from the file repository
deleteFileFromRepository(rcon,
doc_id = 12345)
}
Run the code above in your browser using DataLab