Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Aug 28, 2024
1 parent bdfc665 commit 58d6440
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions R/boot_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' should be any subset of the values `c("norm","basic", "stud", "perc", "bca")` or simply `"all"` which will
#' compute all five types of intervals.
#' @param stype (`string`)\cr a character string indicating what the second argument of statistic represents.
#' Possible values of stype are `"i"` (indices - the default), `"f"` (frequencies), or `"w"` (weights).
#' Possible values of `stype` are `"i"` (indices - the default), `"f"` (frequencies), or `"w"` (weights).
#' @param statistic (`function`)\cr a function which, when applied to data, returns a vector containing the
#' statistic(s) of interest. See the parameter description in [boot::boot()] for details.
#'
Expand Down Expand Up @@ -66,7 +66,6 @@ boot_ci <- function(x,
paste0("All values of t are equal to ", boot$t0, ". Cannot calculate confidence intervals."),
call = get_cli_abort_call()
)

} else {
boot.ci <- boot::boot.ci(boot, conf = conf.level, type = type)

Expand Down
2 changes: 1 addition & 1 deletion man/boot_ci.Rd

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

16 changes: 8 additions & 8 deletions tests/testthat/_snaps/boot_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
3 AGE continuo… conf.level conf.lev… 0.95 bootstra…
4 AGE continuo… R R 2000 bootstra…
5 AGE continuo… ci.type.1 ci.type.1 normal bootstra…
6 AGE continuo… conf.low.1 conf.low… 74.074 bootstra…
7 AGE continuo… conf.high.1 conf.hig… 76.094 bootstra…
6 AGE continuo… conf.low.1 conf.low… 74.081 bootstra…
7 AGE continuo… conf.high.1 conf.hig… 76.11 bootstra…
8 AGE continuo… ci.type.2 ci.type.2 basic bootstra…
9 AGE continuo… conf.low.2 conf.low… 74.091 bootstra…
10 AGE continuo… conf.high.2 conf.hig… 76.063 bootstra…
9 AGE continuo… conf.low.2 conf.low… 74.114 bootstra…
10 AGE continuo… conf.high.2 conf.hig… 76.153 bootstra…
11 AGE continuo… ci.type.3 ci.type.3 percent bootstra…
12 AGE continuo… conf.low.3 conf.low… 74.11 bootstra…
13 AGE continuo… conf.high.3 conf.hig… 76.083 bootstra…
12 AGE continuo… conf.low.3 conf.low… 74.02 bootstra…
13 AGE continuo… conf.high.3 conf.hig… 76.059 bootstra…
14 AGE continuo… ci.type.4 ci.type.4 bca bootstra…
15 AGE continuo… conf.low.4 conf.low… 74.076 bootstra…
16 AGE continuo… conf.high.4 conf.hig… 76.075 bootstra…
15 AGE continuo… conf.low.4 conf.low… 73.992 bootstra…
16 AGE continuo… conf.high.4 conf.hig… 76.04 bootstra…
Message
i 2 more variables: fmt_fn, error

Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-boot_ci.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
skip_if_not(do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "boot", reference_pkg = "cardx")))

test_that("boot_ci() works with standard use", {
set.seed(1)
x <- cards::ADSL$AGE

set.seed(1)
res <- boot_ci(x, type = "perc")
expect_snapshot(res)

set.seed(1)
res <- cards::ADSL |>
cards::ard_continuous(
variables = AGE,
Expand Down

0 comments on commit 58d6440

Please sign in to comment.