From 4db2dc28cffac461f40ca7f6299d7a9814ba9c4e Mon Sep 17 00:00:00 2001 From: Joseph Larmarange Date: Fri, 5 Apr 2024 10:22:42 +0200 Subject: [PATCH] new test --- tests/testthat/test-marginal_tidiers.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/testthat/test-marginal_tidiers.R b/tests/testthat/test-marginal_tidiers.R index 9a428e99..700ab8f5 100644 --- a/tests/testthat/test-marginal_tidiers.R +++ b/tests/testthat/test-marginal_tidiers.R @@ -101,6 +101,14 @@ test_that("tidy_marginal_predictions()", { skip_on_cran() skip_if_not_installed("marginaleffects") + iris <- iris %>% dplyr::arrange(dplyr::desc(Species)) + mod <- lm(Petal.Length ~ Petal.Width + Species + Sepal.Length, data = iris) + expect_error( + t <- tidy_marginal_predictions(mod), + NA + ) + expect_equal(t[t$variable == "Species", "term"], levels(iris$Species)) + mod <- lm(Petal.Length ~ Petal.Width * Species + Sepal.Length, data = iris) expect_error( t <- tidy_marginal_predictions(mod),