Skip to content

Commit

Permalink
Fix failing *marginaleffects* test
Browse files Browse the repository at this point in the history
Fixes #1048
  • Loading branch information
strengejacke committed Nov 26, 2024
1 parent 7fc4b8f commit 0946989
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tests/testthat/test-marginaleffects.R
Original file line number Diff line number Diff line change
@@ -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()", {
Expand All @@ -8,7 +7,7 @@ test_that("marginaleffects()", {
model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, by = "Species"), variables = "Petal.Length")

Check warning on line 7 in tests/testthat/test-marginaleffects.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-marginaleffects.R,line=7,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 121 characters.
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)
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-serp.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 0946989

Please sign in to comment.