tests/testthat/test-calc_network_R.R

test_that("calc_network_R works as expected", {
  expect_snapshot(
    calc_network_R(
      mean_num_contact = 15,
      sd_num_contact = 50,
      infect_duration = 0.5,
      prob_transmission = 1,
      age_range = c(15, 75)
    )
  )

})

test_that("calc_network_R gives equal values when sd is zero", {
  R <- calc_network_R(
    mean_num_contact = 15,
    sd_num_contact = 0,
    infect_duration = 1,
    prob_transmission = 1,
    age_range = c(15, 75)
  )
  expect_equal(R, c(R = 0.25, R_net = 0.25))
})

Try the superspreading package in your browser

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

superspreading documentation built on April 4, 2025, 3:18 a.m.