Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 21, 2023
1 parent c4465c1 commit 54f64e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test-r2.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ test_that("r2 glm, ci", {
tolerance = 1e-3
)
})

test_that("r2 glmmTMB, no ranef", {
skip_if_not_installed("glmmTMB")
data(Owls, package = "glmmTMB")
m <- glmmTMB::glmmTMB(NegPerChick ~ BroodSize + ArrivalTime, data = Owls)
out <- r2(m)
expect_equal(out$R2, 0.05597288, tolerance = 1e-3, ignore_attr = TRUE)
})

0 comments on commit 54f64e2

Please sign in to comment.