From 09469894f9ec537f2d5c40da01061d39fc9f242d Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 26 Nov 2024 13:24:03 +0100 Subject: [PATCH 1/2] Fix failing *marginaleffects* test Fixes #1048 --- tests/testthat/test-marginaleffects.R | 5 ++--- tests/testthat/test-serp.R | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-marginaleffects.R b/tests/testthat/test-marginaleffects.R index ae1df673f..7f8c6c741 100644 --- a/tests/testthat/test-marginaleffects.R +++ b/tests/testthat/test-marginaleffects.R @@ -1,5 +1,4 @@ -skip_if_not_installed("marginaleffects", minimum_version = "0.18.0") -skip_if_not_installed("insight", minimum_version = "0.19.9") +skip_if_not_installed("marginaleffects", minimum_version = "0.24.0") skip_if_not_installed("rstanarm") test_that("marginaleffects()", { @@ -8,7 +7,7 @@ test_that("marginaleffects()", { model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, by = "Species"), variables = "Petal.Length") out <- parameters(model) expect_identical(nrow(out), 1L) - cols <- c("Parameter", "Comparison", "Coefficient", "SE", "Statistic", "p", "S", "CI", "CI_low", "CI_high") + cols <- c("Parameter", "Coefficient", "SE", "Statistic", "p", "S", "CI", "CI_low", "CI_high") expect_true(all(cols %in% colnames(out))) out <- model_parameters(model, exponentiate = TRUE) expect_equal(out$Coefficient, 1.394, tolerance = 1e-3) diff --git a/tests/testthat/test-serp.R b/tests/testthat/test-serp.R index 3dbf04646..a09bb32df 100644 --- a/tests/testthat/test-serp.R +++ b/tests/testthat/test-serp.R @@ -1,5 +1,4 @@ skip_if_not_installed("serp") -skip_if_not_installed("insight", minimum_version = "0.20.0") skip_if_not_installed("withr") # make sure we have the correct interaction mark for tests From 7e78539360517580dafe8bb56f28d22a9ca3e722 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 26 Nov 2024 13:54:43 +0100 Subject: [PATCH 2/2] fix --- tests/testthat/test-marginaleffects.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-marginaleffects.R b/tests/testthat/test-marginaleffects.R index 7f8c6c741..59882f8c0 100644 --- a/tests/testthat/test-marginaleffects.R +++ b/tests/testthat/test-marginaleffects.R @@ -1,4 +1,4 @@ -skip_if_not_installed("marginaleffects", minimum_version = "0.24.0") +skip_if_not_installed("marginaleffects", minimum_version = "1.0.0") skip_if_not_installed("rstanarm") test_that("marginaleffects()", { @@ -7,7 +7,7 @@ test_that("marginaleffects()", { model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, by = "Species"), variables = "Petal.Length") out <- parameters(model) expect_identical(nrow(out), 1L) - cols <- c("Parameter", "Coefficient", "SE", "Statistic", "p", "S", "CI", "CI_low", "CI_high") + cols <- c("Parameter", "Comparison", "Coefficient", "SE", "Statistic", "p", "S", "CI", "CI_low", "CI_high") expect_true(all(cols %in% colnames(out))) out <- model_parameters(model, exponentiate = TRUE) expect_equal(out$Coefficient, 1.394, tolerance = 1e-3)