tests/testthat/test-model_parameters.ggeffects.R

test_that("model_parameters.ggeffects", {
  skip_if_not_installed("ggeffects")
  data(iris)
  mgg <- lm(Sepal.Length ~ Petal.Width + Petal.Length * Species, data = iris)
  model <- ggeffects::ggpredict(mgg, terms = c("Petal.Length", "Species"))
  params <- model_parameters(model)

  expect_named(
    params,
    c("Petal.Length", "Predicted", "CI", "CI_low", "CI_high", "Component")
  )
  expect_snapshot(print(params))
})

Try the parameters package in your browser

Any scripts or data that you put into this service are public.

parameters documentation built on Nov. 2, 2023, 6:13 p.m.