From 959ce85457600f4c5b94344cb279c27433436d13 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 21 Nov 2023 22:46:31 +0100 Subject: [PATCH] test --- tests/testthat/test-r2.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testthat/test-r2.R b/tests/testthat/test-r2.R index 01e492edf..2d52f6b9a 100644 --- a/tests/testthat/test-r2.R +++ b/tests/testthat/test-r2.R @@ -46,4 +46,8 @@ test_that("r2 glmmTMB, no ranef", { m <- glmmTMB::glmmTMB(NegPerChick ~ BroodSize + ArrivalTime, data = Owls) out <- r2(m) expect_equal(out$R2, 0.05597288, tolerance = 1e-3, ignore_attr = TRUE) + # validate against lm + m2 <- lm(NegPerChick ~ BroodSize + ArrivalTime, data = Owls) + out2 <- r2(m2) + expect_equal(out$R2, out2$R2, tolerance = 1e-3, ignore_attr = TRUE) })