if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
# Export all of the Arms
exportArms(rcon)
# Export only a subset of arms
exportArms(rcon,
arms = c(1, 3))
# Import a new arms
# Assume arms 1, 2, and 3 exist in the project already
NewData <- data.frame(arm_num = 4,
name = "Arm Four Name")
importArms(rcon,
data = NewData)
# Change the name of an existing arm
NewData <- data.frame(arm_num = 1,
name = "New Arm Name")
importArms(rcon,
data = NewData)
# Delete all arms and replace with a new specification
NewData <- data.frame(arm_num = c(1, 2),
name = c("Treatment Arm", "Control Arm"))
importArms(rcon,
data = NewData,
override = TRUE)
# Delete an existing arm
deleteArms(rcon,
arms = 4)
# Delete multiple existing arm
deleteArms(rcon,
arms = c(2, 3))
}
Run the code above in your browser using DataLab