tests/testthat/test-measure_diffusion.R

test <- play_diffusion(create_tree(12), steps = 2)

test_that("infection total works", {
  expect_values(net_by_infection_total(test), 0.583)
})

test_that("infection complete works", {
  expect_values(net_by_infection_complete(test), Inf)
})

Try the netrics package in your browser

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

netrics documentation built on July 24, 2026, 5:07 p.m.