Learn R Programming

redcapAPI (version 2.8.0)

switchDag: Switch Data Access Group Assignment for the Current User

Description

This method enables the current API user to switch (assign/reassign/unassign) their current Data Access Group assignment if they have been assigned to multiple DAGs via the DAG Switcher page in the project.

Usage

switchDag(rcon, dag, ...)

# S3 method for redcapApiConnection switchDag( rcon, dag, refresh = TRUE, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

Returns TRUE when the call is completed successfully.

Arguments

rcon

A redcapConnection object.

dag

character(1) A unique data access group to which to assign the current user. Use NA to leave the user unassigned.

refresh

logical(1) If TRUE, the cached data access group assignments will be refreshed.

...

Arguments to pass to other methods

error_handling

character(1). One of c("error", "null"). An option for how to handle errors returned by the API. see redcapError().

config

A named list. Additional configuration parameters to pass to httr::POST(). These are appended to any parameters in rcon$config.

api_param

A named list. Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

See Also

exportDags(),
importDags(),
deleteDags(),
exportUserDagAssignments(),
importUserDagAssignments()

Examples

Run this code
if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())

# Switch the current user to the DAG "Facility Two"
switchDag(rcon, 
          dag = "facility_two")
}

Run the code above in your browser using DataLab