tests/testthat/test-plotting.R

test_that("plot.betadanish runs without errors", {
  set.seed(123)
  dat <- data.frame(time = rbetadanish(30, 1.2, 1.5, 2, 0.5), status = 1)
  fit <- fit_betadanish(survival::Surv(time, status) ~ 1, data = dat, n_starts = 1)

  # Suppress plot output during testing
  grDevices::pdf(NULL)
  on.exit(grDevices::dev.off())

  expect_silent(plot(fit, type = "survival"))
  expect_silent(plot(fit, type = "hazard"))
  expect_silent(plot(fit, type = "all"))
})

Try the BetaDanish package in your browser

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

BetaDanish documentation built on May 20, 2026, 5:07 p.m.