Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 4, 2024
1 parent f8cafc5 commit 8f744d0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/testthat/test-find_transformation.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,19 @@ test_that("find_transformation - detect powers", {
expect_identical(insight::find_transformation(m6), "power")
# styler: on
})


test_that("find_transformation - detect powers", {
skip_if_not_installed("lme4")
data(mtcars)
model <- lme4::lmer(mpg ~ log(wt) + I(gear^2) +exp(am) + vs + (1 | cyl), data = mtcars)

Check warning on line 124 in tests/testthat/test-find_transformation.R

View workflow job for this annotation

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

file=tests/testthat/test-find_transformation.R,line=124,col=49,[infix_spaces_linter] Put spaces around all infix operators.
expect_identical(find_transformation(model), "identity")
expect_identical(
find_transformation(model, full_model = TRUE),
list(
response = c(mpg = "identity"),
conditional = c(wt = "log", gear = "power", am = "exp", vs = "identity"),
random = c(cyl = "identity")
)
)
})

0 comments on commit 8f744d0

Please sign in to comment.