prepUserImportData function

Prepare User Data for Import

Prepare User Data for Import

Prepares a data frame for import via the API. Allows for data to be passed in either the raw format or the labeled data received from exportUsers.

prepUserImportData(data, rcon, consolidate = TRUE, user_role = FALSE)

Arguments

  • data: data.frame with the structure of redcapAPI:::REDCAP_USER_STRUCTURE. It may also have additional columns for the form and export access of each of the instruments.
  • rcon: A redcapConnection object.
  • consolidate: logical(1) If TRUE, the form and data export access values will be read from the expanded columns. Otherwise, the consolidated values (as provided by the API export) are utilized.
  • user_role: logical(1) If TRUE, the code will treat the data as if it is being prepared for importing User Roles.

Returns

Returns a data.frame with user settings that will be accepted by the API for import.

Examples

## Not run: unlockREDCap(connections = c(rcon = "project_alias"), url = "your_redcap_url", keyring = "API_KEYs", envir = globalenv()) # Prep user data NewData <- data.frame(username = "target_user", design = 1, api_export = "Access", api_import = "No Access", surveys_enabled = 0) prepUserImportData(data = NewData, rcon = rcon) # Prep user role data NewData <- data.frame(unique_role_name = "target_user", design = 1, api_export = "Access", api_import = "No Access", surveys_enabled = 0) prepUserImportData(data = NewData, rcon = rcon) ## End(Not run)

See Also

importUsers(),

importUserRoles()

  • Maintainer: Shawn Garbett
  • License: GPL-2
  • Last published: 2024-10-17