tests/testthat/test-surv_median.R

test_that("surv_median calculates medians", {
  df_medians <- surv_median(survfit(Surv(time, status) ~ sex,
                                    data=lung))
  expect_equal(df_medians[['median']], c(270,426))
  expect_lt(df_medians[['lower']][2], 426)
})

Try the survminer package in your browser

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

survminer documentation built on Oct. 30, 2024, 5:06 p.m.