tests/testthat/test-calc_recovered.R

cutoff_data <- tibble::tibble(
  id = 1:5,
  clinical_pre = c(TRUE, FALSE, FALSE, FALSE, FALSE),
  functional_post = c(TRUE, FALSE, FALSE, TRUE, FALSE)
)


rci_data <- tibble::tibble(
  id = 1:5,
  improved = c(TRUE, TRUE, FALSE, FALSE, FALSE),
  deteriorated = c(FALSE, FALSE, FALSE, TRUE, TRUE),
  unchanged = c(FALSE, FALSE, TRUE, FALSE, FALSE)
)

ids <- tibble::tibble(
  id = 1:5,
  rci = "Not needed",
  cs_indiv = "Not needed"
)


test_that("Recovered categories are calculated correctly", {
  expect_snapshot(.calc_recovered(ids, cutoff_data, rci_data))
  expect_snapshot(.calc_recovered_ha(ids, cutoff_data, rci_data))
})

Try the clinicalsignificance package in your browser

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

clinicalsignificance documentation built on April 4, 2025, 12:19 a.m.