Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
wibeasley committed Sep 6, 2022
1 parent 18ea0fb commit 581060e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions R/metadata-utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@
#' uri <- "https://bbmc.ouhsc.edu/redcap/api/"
#' token <- "9A81268476645C4E5F03428B8AC3AA7B"
#'
#' ds_metadata <- redcap_metadata_read(redcap_uri=uri, token=token)$data
#' choices_2 <- ds_metadata[ds_metadata$field_name=="race", ]$select_choices_or_calculations
#' ds_metadata <- redcap_metadata_read(uri, token)$data
#' choices_2 <- ds_metadata[ds_metadata$field_name == "race", ]$select_choices_or_calculations
#'
#' REDCapR::regex_named_captures(pattern=pattern_boxes, text=choices_2)
#' REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_2)
#' }
#'
#' path_3 <- system.file(package="REDCapR", "test-data/project-simple/simple-metadata.csv")
#' path_3 <- system.file(package = "REDCapR", "test-data/project-simple/simple-metadata.csv")
#' ds_metadata_3 <- read.csv(path_3)
#' choices_3 <- ds_metadata_3[ds_metadata_3$field_name=="race", "select_choices_or_calculations"]
#' REDCapR::regex_named_captures(pattern=pattern_boxes, text=choices_3)
#' choices_3 <- ds_metadata_3[ds_metadata_3$field_name == "race", "select_choices_or_calculations"]
#' REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_3)

#' @export
regex_named_captures <- function(pattern, text, perl = TRUE) {
Expand All @@ -97,7 +97,6 @@ regex_named_captures <- function(pattern, text, perl = TRUE) {
))
colnames(d) <- capture_names


for (column_name in colnames(d)) {
d[[column_name]] <- mapply(
function(start, len) {
Expand Down

0 comments on commit 581060e

Please sign in to comment.