diff --git a/R/ard_kruskaltest.R b/R/ard_kruskaltest.R index fd9f48687..9cf6bfd54 100644 --- a/R/ard_kruskaltest.R +++ b/R/ard_kruskaltest.R @@ -11,7 +11,6 @@ #' column name to compare by #' @param variable ([`tidy-select`][dplyr::dplyr_tidy_select])\cr #' column name to be compared -#' @param ... additional arguments passed to `kruskal.test()` #' #' @return ARD data frame #' @export @@ -36,7 +35,7 @@ ard_kruskaltest <- function(data, by, variable, ...) { cards::tidy_as_ard( lst_tidy = cards::eval_capture_conditions( - stats::kruskal.test(x = data[[variable]], g = data[[by]], ...) |> + stats::kruskal.test(x = data[[variable]], g = data[[by]]) |> broom::tidy() ), tidy_result_names = c("statistic", "p.value", "parameter", "method"), diff --git a/man/ard_kruskaltest.Rd b/man/ard_kruskaltest.Rd index 3d25a6a9b..40f90cab8 100644 --- a/man/ard_kruskaltest.Rd +++ b/man/ard_kruskaltest.Rd @@ -15,8 +15,6 @@ column name to compare by} \item{variable}{(\code{\link[dplyr:dplyr_tidy_select]{tidy-select}})\cr column name to be compared} - -\item{...}{additional arguments passed to \code{kruskal.test()}} } \value{ ARD data frame diff --git a/tests/testthat/test-ard_kwtest.R b/tests/testthat/test-ard_kruskaltest.R similarity index 87% rename from tests/testthat/test-ard_kwtest.R rename to tests/testthat/test-ard_kruskaltest.R index 08ab2af37..ba472e612 100644 --- a/tests/testthat/test-ard_kwtest.R +++ b/tests/testthat/test-ard_kruskaltest.R @@ -2,7 +2,7 @@ test_that("ard_kurskaltest() works", { expect_error( ard_kruskaltest <- cards::ADSL |> - ard_kruskaltest(by = ARM, variable = AGEGR1), + ard_kruskaltest(by = ARM, variable = AGE), NA ) @@ -25,12 +25,12 @@ test_that("shuffle_ard fills missing group levels if the group is meaningful", { ard_kruskaltest( data = adsl_sub, by = "ARM", - variable = "AGEGR1" + variable = "AGE" ), ard_kruskaltest( data = adsl_sub, by = "SEX", - variable = "AGEGR1" + variable = "AGE" ) ) |> as.data.frame()