Skip to content

Commit

Permalink
address numeric variable issue and renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
zdz2101 committed Feb 9, 2024
1 parent 2629ff8 commit 041da9e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions R/ard_kruskaltest.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"),
Expand Down
2 changes: 0 additions & 2 deletions man/ard_kruskaltest.Rd

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

Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand All @@ -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()
Expand Down

0 comments on commit 041da9e

Please sign in to comment.