tests/testthat/test-ggsurvfit_build.R

test_that("ggsurvfit_build() works", {
  p <-
    survfit2(Surv(time, status) ~ surg, df_colon) %>%
    ggsurvfit() +
    add_risktable()

  expect_error(
    built_p <- ggsurvfit_build(p, combine_plots = FALSE),
    NA
  )

  expect_true(inherits(built_p, "list"))
})

Try the ggsurvfit package in your browser

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

ggsurvfit documentation built on Nov. 2, 2023, 5:33 p.m.