Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 21, 2025
1 parent 2d30e25 commit 8a35aca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/get_datagrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ get_datagrid.comparisons <- get_datagrid.slopes
} else {
format_error(
paste0(
"The `by` argument (", by, ") should either indicate the minimum and the maximum, or one of the following options: ", # nolint
"The `by` argument (", by, ") should either indicate a valid factor level, the minimum and the maximum value of a vector, or one of the following options: ", # nolint
toString(shortcuts),
"."
)
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-get_datagrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ test_that("get_datagrid - terciles, quartiles, mean-sd", {
dg <- insight::get_datagrid(m, "Species=[setosa]")
expect_identical(dim(dg), c(1L, 3L))

expect_error(
insight::get_datagrid(m, "Species=[petosa]"),
regex = "should either indicate"
)

skip_if_not_installed("ggeffects")
data(efc, package = "ggeffects")
efc$c161sex <- datawizard::to_factor(efc$c161sex)
Expand Down

0 comments on commit 8a35aca

Please sign in to comment.