tests/testthat/test-target_power.R

test_that(".target_power selects the targeted power", {
  res <- list(power = c(pfs = 0.9, os = 0.7, both = 0.65, any = 0.95))
  expect_equal(.target_power(res, "first"), 0.9)
  expect_equal(.target_power(res, "each"), 0.7)
  expect_equal(.target_power(res, "both"), 0.65)
  expect_equal(.target_power(res, "any"), 0.95)
  expect_equal(.target_power(list(power = 0.8), "first"), 0.8)
})

Try the DesignComplexSurvival package in your browser

Any scripts or data that you put into this service are public.

DesignComplexSurvival documentation built on Nov. 23, 2026, 5:07 p.m.