diff --git a/R/checks.R b/R/checks.R index 642ab9bf..39bce242 100644 --- a/R/checks.R +++ b/R/checks.R @@ -124,12 +124,10 @@ check_repeat_and_nonrepeat <- function(db_data, call = caller_env()) { # behavior in a given column and returns a boolean check_data <- function(db_data, check_col) { # Repeating Check - rep <- any(!is.na(db_data[{{ check_col }}]) & - !is.na(db_data["redcap_repeat_instrument"])) + rep <- any(!is.na(db_data[{{ check_col }}]) & !is.na(db_data["redcap_repeat_instrument"])) # Nonrepeating Check - nonrep <- any(!is.na(db_data[{{ check_col }}]) & - is.na(db_data["redcap_repeat_instrument"])) + nonrep <- any(!is.na(db_data[{{ check_col }}]) & is.na(db_data["redcap_repeat_instrument"])) rep & nonrep } @@ -299,8 +297,9 @@ check_req_labelled_metadata_fields <- function(supertbl, call = caller_env()) { #' @importFrom cli cli_warn qty #' @importFrom rlang caller_env #' -#' @param parsed_labs a vector of parsed labels produced by `parse_labels()` +#' @param parsed_labels_output a vector of parsed labels produced by `parse_labels()` #' @param field_name the name of the field associated with the labels to use in the warning message +#' @param warn_stripped_text logical for whether to include a note about HTML tag stripping in the message #' @param call the calling environment to use in the error message. The parent of calling environment #' by default because this check usually occurs 2 frames below the relevant context for the user #' diff --git a/R/write.R b/R/write.R index b4489880..a86659e8 100644 --- a/R/write.R +++ b/R/write.R @@ -417,7 +417,7 @@ add_supertbl_toc <- function(wb, #' a dataframe. #' #' @param supertbl a supertibble generated using `read_redcap()` -#' @param superbl_meta an `unnest`-ed metadata tibble from the supertibble +#' @param supertbl_meta an `unnest`-ed metadata tibble from the supertibble #' @param wb An `openxlsx2` workbook object #' @param add_labelled_column_headers Whether or not to include labelled outputs. #' @param table_style Any excel table style name or "none" (see "formatting" @@ -524,7 +524,7 @@ check_labelled <- function(supertbl, add_labelled_column_headers, call = caller_ #' changes in supertbl tables. #' #' @param supertbl A supertibble generated using `read_redcap()` -#' @param superbl_meta an `unnest`-ed metadata tibble from the supertibble +#' @param supertbl_meta an `unnest`-ed metadata tibble from the supertibble #' @param add_labelled_column_headers Whether or not to include labelled outputs #' #' @importFrom dplyr mutate across case_when filter pull diff --git a/cran-comments.md b/cran-comments.md index e6f584c7..447615be 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -17,7 +17,7 @@ There are no user-facing changes in this release. 1. [Ubuntu Linux 20.04.1 LTS, R-release, GCC](https://builder.r-hub.io/status/REDCapTidieR_0.4.0.9001.tar.gz-f853e048ec7949ed8b7de8b21bef7846) 2. [Fedora Linux, R-devel, clang, gfortran](https://builder.r-hub.io/status/REDCapTidieR_0.4.0.9001.tar.gz-cb2489664ff740b6a2f751757feb6c55) 3. [Windows Server](https://builder.r-hub.io/status/REDCapTidieR_0.4.0.9001.tar.gz-71108297d2fb4e5ea9a80e4eec49946d) -3. [win-builder](https://win-builder.r-project.org/EFDoel1TQ0VI/), development version. +3. [win-builder](https://win-builder.r-project.org/9L4v1qQ3188p/), development version. 4. [GiHub Actions](https://github.com/CHOP-CGTInformatics/REDCapTidieR/actions), Ubuntu 20.04.02 LTS ## R CMD check results: diff --git a/man/add_metadata_sheet.Rd b/man/add_metadata_sheet.Rd index 1fe71032..348df964 100644 --- a/man/add_metadata_sheet.Rd +++ b/man/add_metadata_sheet.Rd @@ -17,6 +17,8 @@ add_metadata_sheet( \arguments{ \item{supertbl}{a supertibble generated using \code{read_redcap()}} +\item{supertbl_meta}{an \code{unnest}-ed metadata tibble from the supertibble} + \item{wb}{An \code{openxlsx2} workbook object} \item{add_labelled_column_headers}{Whether or not to include labelled outputs.} @@ -28,8 +30,6 @@ vignette in \link[openxlsx2]{wb_add_data_table}). Default "tableStyleLight8".} "auto", otherwise a numeric value. Standard Excel is 8.43.} \item{na_replace}{The value used to replace \code{NA} values in \code{supertbl}. The default is "".} - -\item{superbl_meta}{an \code{unnest}-ed metadata tibble from the supertibble} } \value{ A dataframe diff --git a/man/check_parsed_labels.Rd b/man/check_parsed_labels.Rd index aa43316c..f931b9ff 100644 --- a/man/check_parsed_labels.Rd +++ b/man/check_parsed_labels.Rd @@ -12,12 +12,14 @@ check_parsed_labels( ) } \arguments{ +\item{parsed_labels_output}{a vector of parsed labels produced by \code{parse_labels()}} + \item{field_name}{the name of the field associated with the labels to use in the warning message} +\item{warn_stripped_text}{logical for whether to include a note about HTML tag stripping in the message} + \item{call}{the calling environment to use in the error message. The parent of calling environment by default because this check usually occurs 2 frames below the relevant context for the user} - -\item{parsed_labs}{a vector of parsed labels produced by \code{parse_labels()}} } \value{ a warning message alerting specifying the duplicate labels and REDCap field affected diff --git a/man/supertbl_recode.Rd b/man/supertbl_recode.Rd index 6d4984a9..28b0870a 100644 --- a/man/supertbl_recode.Rd +++ b/man/supertbl_recode.Rd @@ -9,9 +9,9 @@ supertbl_recode(supertbl, supertbl_meta, add_labelled_column_headers) \arguments{ \item{supertbl}{A supertibble generated using \code{read_redcap()}} -\item{add_labelled_column_headers}{Whether or not to include labelled outputs} +\item{supertbl_meta}{an \code{unnest}-ed metadata tibble from the supertibble} -\item{superbl_meta}{an \code{unnest}-ed metadata tibble from the supertibble} +\item{add_labelled_column_headers}{Whether or not to include labelled outputs} } \description{ This utility function helps to map metadata field types in order to apply diff --git a/tests/testthat/test-extract_tibble.R b/tests/testthat/test-extract_tibble.R index 0b9ab611..c8c44df9 100644 --- a/tests/testthat/test-extract_tibble.R +++ b/tests/testthat/test-extract_tibble.R @@ -41,8 +41,7 @@ test_that("extract_tibbles works with a vector and tidyselect selectors", { extract_tibbles(tbls = c("nonrepeated", "repeated")), expected_traditional_out ) - expect_error(redcaptidier_longitudintal_db %>% - extract_tibbles(tbls = c("repeated", "fake_instrument_name"))) + expect_error(extract_tibbles(redcaptidier_longitudintal_db, tbls = c("repeated", "fake_instrument_name"))) expect_error(extract_tibbles(123), class = "check_supertbl") })