Skip to content

Commit

Permalink
maybe simpler extraction of permissions
Browse files Browse the repository at this point in the history
ref #163
  • Loading branch information
wibeasley committed Sep 17, 2018
1 parent 67fee06 commit fd46e6b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions R/redcap-users-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,18 @@ redcap_users_export <- function( redcap_uri, token, verbose=TRUE, config_options
ds_user_form <- ds_combined %>%
dplyr::select_("username", "forms") %>%
tidyr::separate_rows(.data$forms, sep=",") %>%
tidyr::separate_(
col = "forms",
into = c("form_name", "permission"),
sep = ":",
convert = FALSE
) %>%
# tidyr::separate_(
# col = "form",
# into = c("form_name", "permission"),
# sep = ":",
# convert = FALSE
# ) %>%
dplyr::mutate(
form_name = sub("^(\\w+):([0-2])$", "\\1", .data$forms),
permission = sub("^(\\w+):([0-2])$", "\\2", .data$forms),
permission = as.logical(as.integer(.data$permission))
)
) %>%
dplyr::select_("-forms")
},
silent = TRUE #Don't print the warning in the try block. Print it below, where it's under the control of the caller.
)
Expand Down

0 comments on commit fd46e6b

Please sign in to comment.