From bc7a323c53f03226153912d38b7269323b9e93cb Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 22 Sep 2023 13:15:23 +0200 Subject: [PATCH] fix tests --- R/n_obs.R | 1 + tests/testthat/test-glmmTMB.R | 2 +- tests/testthat/test-rstanarm.R | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/R/n_obs.R b/R/n_obs.R index 5fb13bc30..323bc2057 100644 --- a/R/n_obs.R +++ b/R/n_obs.R @@ -91,6 +91,7 @@ n_obs.glm <- function(x, disaggregate = FALSE, ...) { } else if (!is.data.frame(resp_data) && .is.fraction(resp_data)) { .nobs <- sum(get_weights(x)) } + .nobs <- as.integer(.nobs) } .nobs diff --git a/tests/testthat/test-glmmTMB.R b/tests/testthat/test-glmmTMB.R index 821d47f11..b3d6316b3 100644 --- a/tests/testthat/test-glmmTMB.R +++ b/tests/testthat/test-glmmTMB.R @@ -964,7 +964,7 @@ test_that("model_info, ordered beta", { m <- glmmTMB::glmmTMB( y ~ Days + (Days | Subject), data = sleepstudy, - family = ordbeta() + family = glmmTMB::ordbeta() ) out <- model_info(m) expect_true(out$is_orderedbeta) diff --git a/tests/testthat/test-rstanarm.R b/tests/testthat/test-rstanarm.R index ac1e7c515..66313d98d 100644 --- a/tests/testthat/test-rstanarm.R +++ b/tests/testthat/test-rstanarm.R @@ -233,8 +233,8 @@ test_that("model_info-stanreg-glm", { }) test_that("n_parameters", { - expect_identical(n_parameters(m1), 21) - expect_identical(n_parameters(m1, effects = "fixed"), 5) + expect_identical(n_parameters(m1), 21L) + expect_identical(n_parameters(m1, effects = "fixed"), 5L) }) test_that("get_priors", {