tests/testthat/test-formula.R

context("Diffusion Regression")

test_that("Errors and warnings", {

  data("medInnovationsDiffNet")
  expect_error(diffreg(~exposure), "not a `diffnet`")
  expect_error(diffreg(medInnovationsDiffNet~proage), "No `exposure`")

  expect_warning(
    diffreg(medInnovationsDiffNet~proage+exposure(lags = 0) + factor(per)),
    "not lagged"
  )
  expect_warning(
    diffreg(medInnovationsDiffNet~proage+exposure),
    "naturally increases over time"
  )


})

Try the netdiffuseR package in your browser

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

netdiffuseR documentation built on Aug. 30, 2023, 5:07 p.m.