purgeRestoreProject | R Documentation |
These functions are primarily intended to assist with testing
features of redcapAPI
. Purging and restoring project data permits
us to perform tests on different project structures without having to
manage multiple projects or API tokens.
When purging project data, many of these actions may only be performed with a project in development status, as they are potentially destructive and may result in data loss. It is a good practice to back up your data and project structure before purging a project.
purgeProject(rcon, ...)
## S3 method for class 'redcapApiConnection'
purgeProject(
rcon,
arms = FALSE,
events = FALSE,
users = FALSE,
user_roles = FALSE,
dags = FALSE,
records = FALSE,
purge_all = FALSE,
flush = TRUE,
...
)
restoreProject(object, ...)
## S3 method for class 'redcapApiConnection'
restoreProject(
object,
project_information = NULL,
arms = NULL,
events = NULL,
meta_data = NULL,
mappings = NULL,
repeating_instruments = NULL,
users = NULL,
user_roles = NULL,
user_role_assignments = NULL,
dags = NULL,
dag_assignments = NULL,
records = NULL,
flush = TRUE,
...
)
## S3 method for class 'list'
restoreProject(object, ..., rcon)
... |
Arguments to pass to other methods |
arms |
Either |
events |
Either |
users |
Either |
user_roles |
Either |
dags |
Either |
records |
Either |
purge_all |
|
flush |
|
object , rcon |
A |
project_information |
|
meta_data |
A |
mappings |
A |
repeating_instruments |
A |
user_role_assignments |
A |
dag_assignments |
A |
When restoring a project, all arguments are optional. Any argument
that is NULL
will result in no import being made. The order of
reconstructing the project is (purging data occurs in the reverse order):
Update project information
Import Arms Data
Import Events Data
Import Meta Data
Import Mappings
Import Repeating Instruments
Import Users
Import User Roles
Import User-Role Assignments
Import Data Access Groups
Import Data Access Group Assignments
Import Records
## Not run:
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
# Preserve a project
preserveProject(rcon)
# Purge a project
purgeProject(rcon,
purge_all = TRUE)
# Restore a project
restoreProject(rcon)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.