Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Feb 1, 2024
1 parent 492545f commit 65c5412
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
6 changes: 4 additions & 2 deletions R/ard_wilcoxtest.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ ard_paired_wilcoxtest <- function(data, by, variable, id, ...) {
cards::tidy_as_ard(
lst_tidy = lst_tidy,
tidy_result_names = c("statistic", "p.value", "method", "alternative"),
fun_args_to_record = c("mu", "paired", "exact", "correct", "conf.int",
"conf.level", "tol.root", "digits.rank"),
fun_args_to_record = c(
"mu", "paired", "exact", "correct", "conf.int",
"conf.level", "tol.root", "digits.rank"
),
formals = formals(asNamespace("stats")[["wilcox.test.default"]]),
passed_args = c(list(paired = paired), dots_list(...)),
lst_ard_columns = list(group1 = by, variable = variable, context = "ttest")
Expand Down
18 changes: 11 additions & 7 deletions tests/testthat/test-ard_wilcoxtest.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ test_that("ard_paired_wilcoxtest() works", {
expect_error(
ard_paired_wilcoxtest <-
ADSL_paired |>
ard_paired_wilcoxtest(by = ARM, variable = AGE, id = USUBJID,
correct = FALSE, conf.int = TRUE),
ard_paired_wilcoxtest(
by = ARM, variable = AGE, id = USUBJID,
correct = FALSE, conf.int = TRUE
),
NA
)

Expand All @@ -62,9 +64,9 @@ test_that("ard_paired_wilcoxtest() works", {
correct = FALSE,
conf.int = TRUE
) |>
broom::tidy() |>
dplyr::select(estimate, conf.low, conf.high) |>
unclass()
broom::tidy() |>
dplyr::select(estimate, conf.low, conf.high) |>
unclass()
),
ignore_attr = TRUE
)
Expand All @@ -75,8 +77,10 @@ test_that("ard_paired_wilcoxtest() works", {
dplyr::mutate(
ARM = ifelse(dplyr::row_number() == 1L, "3rd ARM", ARM)
) |>
ard_paired_wilcoxtest(by = ARM, variable = AGE, id = USUBJID,
correct = FALSE, conf.int = TRUE) |>
ard_paired_wilcoxtest(
by = ARM, variable = AGE, id = USUBJID,
correct = FALSE, conf.int = TRUE
) |>
as.data.frame()
)
})

0 comments on commit 65c5412

Please sign in to comment.