Skip to content

Commit

Permalink
[skip style] [skip vbump] Restyle files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 11, 2024
1 parent b647e66 commit b2b2969
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions R/analyze_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ a_summary <- function(x,

# If one col has NA vals, must add NA row to other cols (using placeholder lvl `fill-na-level`)
if (any(is.na(dots_extra_args$.df_row[[dots_extra_args$.var]])) &&
!any(is.na(x)) &&
!na.rm) {
!any(is.na(x)) &&
!na.rm) {
levels(x) <- c(levels(x), "fill-na-level")
}

Expand Down
10 changes: 6 additions & 4 deletions R/utils_default_stats_formats_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ get_and_check_stats_names <- function(stat_results, stat_names_in = NULL) {
}

# Check for number of stat names per stat output
for (ii in seq_along(stat_results)){
for (ii in seq_along(stat_results)) {
internal_groups_stat_length <- lapply(stat_results[[ii]], length)
for (jj in seq_along(internal_groups_stat_length)) {
if (internal_groups_stat_length[[jj]] != length(out[[ii]])) {
stop("The number of stat names for ", names(stat_results)[ii],
"(", internal_groups_stat_length[[jj]], ")",
" is not equal to the number of statistical outputs.")
stop(
"The number of stat names for ", names(stat_results)[ii],
"(", internal_groups_stat_length[[jj]], ")",
" is not equal to the number of statistical outputs."
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-utils_default_stats_formats_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,5 @@ testthat::test_that("get_and_check_stats_names works fine", {
testthat::expect_error(
out <- get_and_check_stats_names(stat_results, list("n" = c("1", "2"))),
"The number of stat names for n"
)
)
})

0 comments on commit b2b2969

Please sign in to comment.