tests/testthat/test_aic_calc.R

context('aic.calc tests')


test_that('aic.calc returns correct values',{
  data(musdata)
  coords <- musdata[ ,4:5]
  mglm <- glm(musculus ~ pollution + exposure, "poisson", musdata)

  aic <- aic.calc(musculus ~ pollution + exposure, "poisson", musdata,
                  mglm$fitted)

  expect_equal(aic$AIC, mglm$aic, tolerance = 1e-2)
  expect_match(class(aic), 'list')

})

Try the spind package in your browser

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

spind documentation built on Jan. 13, 2021, 6:04 p.m.