diff --git a/inst/WORDLIST b/inst/WORDLIST index 5e73a514..7021a09c 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -17,8 +17,10 @@ REDCapTidieR's RStudio Recode Recoding +Stata Supertibble Supertibbles +TRUEs Tibble Tibble's Tibbles @@ -30,6 +32,7 @@ analytics api appendings cli +de dplyr dropdown edu @@ -38,6 +41,7 @@ ggplot gtsummary https httptest +interpretable labelled multiselection nonrepeat @@ -48,12 +52,15 @@ preprocess recode recoded recodes +recoding skimr summarise supertbl supertibble supertibble's +supertibbles tableStyleLight +tbl tibble tibble's tibbles @@ -62,7 +69,6 @@ tidyverse truefalse undirected unlabelled -wb xlsx yesno ︎ diff --git a/man/convert_checkbox_vals.Rd b/man/convert_checkbox_vals.Rd index 9aa48cf4..b1398fbc 100644 --- a/man/convert_checkbox_vals.Rd +++ b/man/convert_checkbox_vals.Rd @@ -33,10 +33,10 @@ This function takes a single column of data and converts the values based on the overall data tibble cross referenced with a nested section of the metadata tibble. -\code{\link[=case_when]{case_when()}} logic helps determine whether the value is a coalesced singular +\code{case_when} logic helps determine whether the value is a coalesced singular value or a user-specified one via \code{multi_value_label} or \code{values_fill}. } \details{ -This function is used in conjunction with \code{\link[=pmap]{pmap()}}. +This function is used in conjunction with \code{pmap()}. } \keyword{internal} diff --git a/tests/testthat/test-read_redcap.R b/tests/testthat/test-read_redcap.R index 769b0d53..59f1d762 100644 --- a/tests/testthat/test-read_redcap.R +++ b/tests/testthat/test-read_redcap.R @@ -680,5 +680,4 @@ test_that("get_repeat_event_types() works", { ) expect_equal(out, expected_out) - }) diff --git a/utility/cli_message_examples_reprex.md b/utility/cli_message_examples_reprex.md index 4234a231..2413a8d8 100644 --- a/utility/cli_message_examples_reprex.md +++ b/utility/cli_message_examples_reprex.md @@ -34,13 +34,9 @@ read_redcap(letters[1:3], classic_token) read_redcap("https://www.google.com", classic_token) #> Error in `read_redcap()`: #> ✖ The REDCapR export operation was not successful. -#> ! An unexpected error occured. -#> ℹ This means that you probably discovered a bug! -#> ℹ Please consider submitting a bug report here: -#> . -#> Caused by error in `redcap_metadata_read()`: -#> ! The REDCapR metadata export operation was not successful. The error message was: -#>

404 Not Found

+#> ! The URL returned the HTTP error code 405 (POST Method not allowed). +#> ℹ Are you sure the URI points to an active REDCap API endpoint? +#> ℹ URI: `https://www.google.com` read_redcap("https://www.google.comm", classic_token) #> Error in `read_redcap()`: @@ -63,13 +59,13 @@ read_redcap(redcap_uri, letters[1:3]) read_redcap(redcap_uri, "") #> Error in `read_redcap()`: -#> ✖ The token is an empty string, not a valid 32-character hexademical -#> value. +#> ✖ The token is an empty string, which is not allowed. #> ℹ API token: `` read_redcap(redcap_uri, "CC0CE44238EF65C5DA26A55DD749AF7") # 31 hex characters #> Error in `read_redcap()`: -#> ✖ The token is not a valid 32-character hexademical value. +#> ✖ The token does not conform with the regex +#> `^([0-9A-Fa-f]{32})(?:\n)?$`. #> ℹ API token: `CC0CE44238EF65C5DA26A55DD749AF7` read_redcap(redcap_uri, "CC0CE44238EF65C5DA26A55DD749AF7A") # will be rejected by server @@ -259,7 +255,7 @@ withr::with_tempdir({ }) #> Error: #> ✖ File -#> ''/private/var/folders/9c/k1m0bzys7gb1v32g86hfn5sn5k86h1/T/Rtmp1QPC0p/file5c744dd73619/temp.csv'' +#> ''/private/var/folders/qc/mmjjyjq50530z9r_7mfqcqfhxkkk67/T/Rtmph4LQ3Z/filee5aa7b9bea48/temp.csv'' #> already exists. #> ℹ Overwriting files is disabled by default. Set `overwrite = TRUE` to overwrite #> existing file. @@ -300,25 +296,26 @@ withr::with_tempdir({ write_redcap_xlsx(file = filepath) }) #> Warning in write_redcap_xlsx(., file = filepath): ! No extension provided for `file`: -#> '/private/var/folders/9c/k1m0bzys7gb1v32g86hfn5sn5k86h1/T/Rtmp1QPC0p/file5c7456597c2b/temp' +#> '/private/var/folders/qc/mmjjyjq50530z9r_7mfqcqfhxkkk67/T/Rtmph4LQ3Z/filee5aa11455c98/temp' #> ℹ The extension '.xlsx' will be appended to the file name. # Printed supertibble read_redcap(Sys.getenv("REDCAP_URI"), Sys.getenv("REDCAPTIDIER_CLASSIC_API")) %>% suppressWarnings() -#> # A REDCapTidieR Supertibble with 9 instruments -#> redcap_form_name redcap_form_label redcap_data redcap_metadata structure -#> -#> 1 nonrepeated Nonrepeated nonrepea… -#> 2 nonrepeated2 Nonrepeated2 nonrepea… -#> 3 repeated Repeated repeating -#> 4 data_field_types Data Field Types nonrepea… -#> 5 text_input_validation… Text Input Valid… nonrepea… -#> 6 api_no_access API No Access nonrepea… -#> 7 api_no_access_2 API No Access 2 nonrepea… -#> 8 survey Survey nonrepea… -#> 9 repeat_survey Repeat Survey repeating +#> # A REDCapTidieR Supertibble with 10 instruments +#> redcap_form_name redcap_form_label redcap_data redcap_metadata structure +#> +#> 1 nonrepeated Nonrepeated nonrepea… +#> 2 nonrepeated2 Nonrepeated2 nonrepea… +#> 3 repeated Repeated repeating +#> 4 data_field_types Data Field Types nonrepea… +#> 5 text_input_validatio… Text Input Valid… nonrepea… +#> 6 api_no_access API No Access nonrepea… +#> 7 api_no_access_2 API No Access 2 nonrepea… +#> 8 survey Survey nonrepea… +#> 9 repeat_survey Repeat Survey repeating +#> 10 labelled_vignette Labelled Vignette nonrepea… #> # ℹ 5 more variables: data_rows , data_cols , data_size , #> # data_na_pct , form_complete_pct @@ -343,4 +340,4 @@ read_redcap(redcap_uri, Sys.getenv("REDCAPTIDIER_MDC_API")) #> # data_na_pct , form_complete_pct ``` -Created on 2024-04-10 with [reprex v2.1.0](https://reprex.tidyverse.org) +Created on 2024-10-16 with [reprex v2.1.0](https://reprex.tidyverse.org) diff --git a/utility/microbenchmark_results.csv b/utility/microbenchmark_results.csv index a7186b18..d572548a 100644 --- a/utility/microbenchmark_results.csv +++ b/utility/microbenchmark_results.csv @@ -1,42 +1,42 @@ min,lq,mean,median,uq,max,neval,description,source -1.15,1.15,1.15,1.15,1.15,1.15,1,simple static (read-only) test project,ouhsc -1.7,1.7,1.7,1.7,1.7,1.7,1,longitudinal (read-only) ARM test project,ouhsc -0.83,0.83,0.83,0.83,0.83,0.83,1,simple write data,ouhsc -1.79,1.79,1.79,1.79,1.79,1.79,1,Russian Characters,ouhsc -3.37,3.37,3.37,3.37,3.37,3.37,1,"super-wide --3,000 columns",ouhsc -1,1,1,1,1,1,1,static (not longitudinal) survey test project,ouhsc -0.82,0.82,0.82,0.82,0.82,0.82,1,"Clinical Trial (Fake) --Read-only, contributed by @higgi13425",ouhsc -0.77,0.77,0.77,0.77,0.77,0.77,1,nonnumeric record_id,ouhsc -0.94,0.94,0.94,0.94,0.94,0.94,1,DAG Read,ouhsc -0.82,0.82,0.82,0.82,0.82,0.82,1,potentially problematic values,ouhsc -0.81,0.81,0.81,0.81,0.81,0.81,1,Repeating Instruments,ouhsc -0.81,0.81,0.81,0.81,0.81,0.81,1,simple write metadata,ouhsc -0.81,0.81,0.81,0.81,0.81,0.81,1,DAG Write -admin,ouhsc -0.81,0.81,0.81,0.81,0.81,0.81,1,DAG Write -group A,ouhsc -129.61,129.61,129.61,129.61,129.61,129.61,1,"super-wide #3--35,000 columns",ouhsc -0.82,0.82,0.82,0.82,0.82,0.82,1,Repeating Instruments --Sparse,ouhsc -0.8,0.8,0.8,0.8,0.8,0.8,1,Delete Single Arm,ouhsc -1.29,1.29,1.29,1.29,1.29,1.29,1,Delete Multiple Arm,ouhsc -1.55,1.55,1.55,1.55,1.55,1.55,1,longitudinal single arm,ouhsc -0.78,0.78,0.78,0.78,0.78,0.78,1,decimal comma and dot,ouhsc -0.82,0.82,0.82,0.82,0.82,0.82,1,decimal comma,ouhsc -0.81,0.81,0.81,0.81,0.81,0.81,1,decimal dot,ouhsc -0.87,0.87,0.87,0.87,0.87,0.87,1,Validation Types,ouhsc -0.81,0.81,0.81,0.81,0.81,0.81,1,Blank for Gray Status,ouhsc -0.97,0.97,0.97,0.97,0.97,0.97,1,Checkboxes 1,ouhsc -0.83,0.83,0.83,0.83,0.83,0.83,1,Vignette: Longitudinal & Repeating Measures,ouhsc -1.11,1.11,1.11,1.11,1.11,1.11,1,classic,redcaptidier -0.98,0.98,0.98,0.98,0.98,0.98,1,classic no repeat,redcaptidier -1.7,1.7,1.7,1.7,1.7,1.7,1,longitudinal,redcaptidier -1.67,1.67,1.67,1.67,1.67,1.67,1,longitudinal no arms,redcaptidier -1.51,1.51,1.51,1.51,1.51,1.51,1,longitudinal no repeat,redcaptidier -1.96,1.96,1.96,1.96,1.96,1.96,1,deep dive vignette,redcaptidier -0.99,0.99,0.99,0.99,0.99,0.99,1,repeat first instrument,redcaptidier -1.51,1.51,1.51,1.51,1.51,1.51,1,repeat event,redcaptidier -1.04,1.04,1.04,1.04,1.04,1.04,1,restricted access,redcaptidier -0.97,0.97,0.97,0.97,0.97,0.97,1,large sparse db,redcaptidier -1.13,1.13,1.13,1.13,1.13,1.13,1,data access groups,redcaptidier -1.78,1.78,1.78,1.78,1.78,1.78,1,longitudinal data access groups,redcaptidier -2.06,2.06,2.06,2.06,2.06,2.06,1,mixed structure repeat no repeat,redcaptidier -4.62,4.62,4.62,4.62,4.62,4.62,1,prodigy db,redcaptidier -5.26,5.26,5.26,5.26,5.26,5.26,1,cart comprehensive db,redcaptidier +0.96,0.96,0.96,0.96,0.96,0.96,1,simple static (read-only) test project,ouhsc +2.35,2.35,2.35,2.35,2.35,2.35,1,longitudinal (read-only) ARM test project,ouhsc +0.99,0.99,0.99,0.99,0.99,0.99,1,simple write data,ouhsc +4.29,4.29,4.29,4.29,4.29,4.29,1,Russian Characters,ouhsc +6.67,6.67,6.67,6.67,6.67,6.67,1,"super-wide --3,000 columns",ouhsc +1.72,1.72,1.72,1.72,1.72,1.72,1,static (not longitudinal) survey test project,ouhsc +1.43,1.43,1.43,1.43,1.43,1.43,1,"Clinical Trial (Fake) --Read-only, contributed by @higgi13425",ouhsc +1.12,1.12,1.12,1.12,1.12,1.12,1,nonnumeric record_id,ouhsc +0.97,0.97,0.97,0.97,0.97,0.97,1,DAG Read,ouhsc +0.9,0.9,0.9,0.9,0.9,0.9,1,potentially problematic values,ouhsc +1.13,1.13,1.13,1.13,1.13,1.13,1,simple write metadata,ouhsc +0.89,0.89,0.89,0.89,0.89,0.89,1,DAG Write -admin,ouhsc +0.95,0.95,0.95,0.95,0.95,0.95,1,DAG Write -group A,ouhsc +1278.89,1278.89,1278.89,1278.89,1278.89,1278.89,1,"super-wide #3--35,000 columns",ouhsc +0.99,0.99,0.99,0.99,0.99,0.99,1,Repeating Instruments --Sparse,ouhsc +1.1,1.1,1.1,1.1,1.1,1.1,1,Delete Single Arm,ouhsc +2.35,2.35,2.35,2.35,2.35,2.35,1,Delete Multiple Arm,ouhsc +2.13,2.13,2.13,2.13,2.13,2.13,1,longitudinal single arm,ouhsc +1.25,1.25,1.25,1.25,1.25,1.25,1,decimal comma and dot,ouhsc +1.32,1.32,1.32,1.32,1.32,1.32,1,decimal comma,ouhsc +1.09,1.09,1.09,1.09,1.09,1.09,1,decimal dot,ouhsc +1.21,1.21,1.21,1.21,1.21,1.21,1,Validation Types,ouhsc +0.99,0.99,0.99,0.99,0.99,0.99,1,Blank for Gray Status,ouhsc +1.32,1.32,1.32,1.32,1.32,1.32,1,Checkboxes 1,ouhsc +1.13,1.13,1.13,1.13,1.13,1.13,1,Vignette: Longitudinal & Repeating Measures,ouhsc +3.01,3.01,3.01,3.01,3.01,3.01,1,classic,redcaptidier +3.34,3.34,3.34,3.34,3.34,3.34,1,classic no repeat,redcaptidier +3.1,3.1,3.1,3.1,3.1,3.1,1,longitudinal,redcaptidier +2.88,2.88,2.88,2.88,2.88,2.88,1,longitudinal no arms,redcaptidier +3.5,3.5,3.5,3.5,3.5,3.5,1,longitudinal no repeat,redcaptidier +5.16,5.16,5.16,5.16,5.16,5.16,1,deep dive vignette,redcaptidier +2.8,2.8,2.8,2.8,2.8,2.8,1,repeat first instrument,redcaptidier +4.69,4.69,4.69,4.69,4.69,4.69,1,repeat event,redcaptidier +2.42,2.42,2.42,2.42,2.42,2.42,1,restricted access,redcaptidier +1.99,1.99,1.99,1.99,1.99,1.99,1,large sparse db,redcaptidier +1.63,1.63,1.63,1.63,1.63,1.63,1,data access groups,redcaptidier +3.62,3.62,3.62,3.62,3.62,3.62,1,longitudinal data access groups,redcaptidier +3.16,3.16,3.16,3.16,3.16,3.16,1,mixed structure repeat no repeat,redcaptidier +11.29,11.29,11.29,11.29,11.29,11.29,1,prodigy db,redcaptidier +15.8,15.8,15.8,15.8,15.8,15.8,1,cart comprehensive db,redcaptidier +34.07,34.07,34.07,34.07,34.07,34.07,1,bmt outcomes db,redcaptidier diff --git a/utility/test_creds.R b/utility/test_creds.R index 4f8fbf1b..849df456 100644 --- a/utility/test_creds.R +++ b/utility/test_creds.R @@ -9,12 +9,13 @@ ouhsc_creds <- readr::read_csv(file = "utility/redcapr.example.credentials", ski select(redcap_uri, token, comment) # Remove identified APIs that don't work -ouhsc_creds <- ouhsc_creds[-c(5,6,10,15,19),] +ouhsc_creds <- ouhsc_creds[-c(5,6,10,14,15,19),] # Empty rows (dataframe with 0 rows, 0 columns) # Single Column (dataframe with 0 rows, 0 columns) # Missing/invalid token, "---" (REDCapR errors as well) # Potentially problematic dictionary (dataframe with 0 rows, 0 columns) # super-wide #2--5,785 columns (dataframe with 0 rows, 0 columns) +# repeat instrument, no longer a working api key # Load REDCapTidieR and CGTI creds redcaptidier_creds <- tibble::tribble(