tests/testthat/test-calc_summary_measures.R

samples <- data.frame(value = 1:10, type = "car")

test_that("calc_summary_measures works as expected with default arguments", {
  expect_snapshot_output(calc_summary_measures(samples))
})

test_that("calc_CrI works as expected when grouping", {
  expect_snapshot_output(calc_summary_measures(samples, summarise_by = "type"))
})

test_that("calc_CrI works as expected when given a custom CrI list", {
  expect_snapshot_output(
    calc_summary_measures(samples, CrIs = c(0.1, 0.4, 0.95))
  )
})

Try the EpiNow2 package in your browser

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

EpiNow2 documentation built on Sept. 26, 2023, 5:11 p.m.