tests/testthat/test-utility.R

test_that("best_model function returns best-model and mean", {

  u1 <- unlist(best_model(rwToT_test_file_A, 36)$best_model_rmst_mean[2])
  expected_result <- "Weibull"
  expect_equal(u1, expected_result)
})

test_that("count_proportion function returns count and proportions", {

  #for AML dataset there are 5 rows with CNSR status 0 and 18 with CNSR status 1
  u2 <- count_proportion(rwToT_aml)
  expected_result <- c("5 (21.7%)", "18 (78.3%)")
  expect_equal(u2, expected_result)
})
sutsabs/rwToT2 documentation built on Feb. 18, 2022, 2:30 a.m.