Skip to content

Commit

Permalink
new test
Browse files Browse the repository at this point in the history
  • Loading branch information
larmarange committed Apr 5, 2024
1 parent d81e4b5 commit 4db2dc2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test-marginal_tidiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 4db2dc2

Please sign in to comment.