Skip to content

Commit fd46e6b

Browse files
committed
maybe simpler extraction of permissions
ref #163
1 parent 67fee06 commit fd46e6b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

R/redcap-users-export.R

+10-7
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,18 @@ redcap_users_export <- function( redcap_uri, token, verbose=TRUE, config_options
9292
ds_user_form <- ds_combined %>%
9393
dplyr::select_("username", "forms") %>%
9494
tidyr::separate_rows(.data$forms, sep=",") %>%
95-
tidyr::separate_(
96-
col = "forms",
97-
into = c("form_name", "permission"),
98-
sep = ":",
99-
convert = FALSE
100-
) %>%
95+
# tidyr::separate_(
96+
# col = "form",
97+
# into = c("form_name", "permission"),
98+
# sep = ":",
99+
# convert = FALSE
100+
# ) %>%
101101
dplyr::mutate(
102+
form_name = sub("^(\\w+):([0-2])$", "\\1", .data$forms),
103+
permission = sub("^(\\w+):([0-2])$", "\\2", .data$forms),
102104
permission = as.logical(as.integer(.data$permission))
103-
)
105+
) %>%
106+
dplyr::select_("-forms")
104107
},
105108
silent = TRUE #Don't print the warning in the try block. Print it below, where it's under the control of the caller.
106109
)

0 commit comments

Comments
 (0)