Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 14, 2024
1 parent 08eb9e0 commit 0533558
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-check_residuals.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_that("check_singularity, lme4", {
skip_on_cran()
skip_if_not_installed("DHARMa")
set.seed(123)
dat <- DHARMa::createData(sampleSize = 100, overdispersion = 0.5, family = poisson())
m <- glm(observedResponse ~ Environment1, family = poisson(), data = dat)
res <- simulate_residuals(m)
out <- check_residuals(res)
expect_equal(out, 0.01884602, ignore_attr = TRUE, tolerance = 1e-4)
expect_identical(
capture.output(print(out)),
"Warning: Non-uniformity of simulated residuals detected (p = 0.019)."
)
})

0 comments on commit 0533558

Please sign in to comment.