diff --git a/R/ard_aod_wald_test.R b/R/ard_aod_wald_test.R index f7288c3f..dc6fb151 100644 --- a/R/ard_aod_wald_test.R +++ b/R/ard_aod_wald_test.R @@ -11,15 +11,14 @@ #' @return data frame #' @export #' -#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "aod", reference_pkg = "cardx")) +#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("aod", "broom.helpers"), reference_pkg = "cardx")) #' lm(AGE ~ ARM, data = cards::ADSL) |> #' ard_aod_wald_test() ard_aod_wald_test <- function(x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, ...) { set_cli_abort_call() - check_pkg_installed("broom.helpers", reference_pkg = "cardx") # check installed packages --------------------------------------------------- - check_pkg_installed("aod", reference_pkg = "cardx") + check_pkg_installed(c("aod", "broom.helpers"), reference_pkg = "cardx") # check inputs --------------------------------------------------------------- check_not_missing(x) diff --git a/man/ard_aod_wald_test.Rd b/man/ard_aod_wald_test.Rd index 0d7ec612..d399c6db 100644 --- a/man/ard_aod_wald_test.Rd +++ b/man/ard_aod_wald_test.Rd @@ -26,7 +26,7 @@ Function takes a regression model object and calculates Wald statistical test using \code{\link[aod:wald.test]{aod::wald.test()}}. } \examples{ -\dontshow{if (do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "aod", reference_pkg = "cardx"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("aod", "broom.helpers"), reference_pkg = "cardx"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} lm(AGE ~ ARM, data = cards::ADSL) |> ard_aod_wald_test() \dontshow{\}) # examplesIf} diff --git a/tests/testthat/test-ard_aod_wald_test.R b/tests/testthat/test-ard_aod_wald_test.R index 58907cd8..10095906 100644 --- a/tests/testthat/test-ard_aod_wald_test.R +++ b/tests/testthat/test-ard_aod_wald_test.R @@ -1,4 +1,4 @@ -skip_if_not(do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "aod", reference_pkg = "cardx"))) +skip_if_not(do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("aod", "broom.helpers"), reference_pkg = "cardx"))) test_that("ard_aod_wald_test() works", { # works for a generic case