Skip to content

Commit

Permalink
Merge 8fbf5f4 into 2290a30
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg authored Sep 27, 2024
2 parents 2290a30 + 8fbf5f4 commit ff5dd25
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/replace_null_statistic.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Replace NULL Statistics with Specified Value
#'
#' When a statistical summary function errors, the `"statistic"` column will be
#' When a statistical summary function errors, the `"stat"` column will be
#' `NULL`. It is, however, sometimes useful to replace these values with a
#' non-`NULL` value, e.g. `NA`.
#'
Expand Down
3 changes: 2 additions & 1 deletion R/shift_ard_columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ rename_ard_columns <- function(x, columns = c(all_ard_groups(), all_ard_variable
if (length(unlisted) != length(x[[unlist_var]])) {
cli::cli_abort(
c("Cannot unlist column {.val {unlist_var}}. The unlisted result is not the same length as the original.",
"i" = "This often occurs when the column contains {.code NULL} values."
"i" = "This often occurs when the column contains {.code NULL} values.",
if (unlist_var == "stat") c("*" = "Run {.fun cards::replace_null_statistic} to replace {.code NULL} values with {.val {NA}}.") # styler: off
),
call = get_cli_abort_call()
)
Expand Down
2 changes: 1 addition & 1 deletion man/replace_null_statistic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat/_snaps/rename_ard_columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
Error in `rename_ard_columns()`:
! Cannot unlist column "stat". The unlisted result is not the same length as the original.
i This often occurs when the column contains `NULL` values.
* Run `cards::replace_null_statistic()` to replace `NULL` values with NA.

0 comments on commit ff5dd25

Please sign in to comment.