tests/testthat/test-plt-coef.R

test_that("bcat_plt_coef works with single model", {
  m <- lm(mpg ~ wt + hp + cyl, data = mtcars)
  p <- bcat_plt_coef(m)
  expect_true(inherits(p, "ggplot"))
})

test_that("bcat_plt_coef works with multiple models", {
  m1 <- lm(mpg ~ wt + hp, data = mtcars)
  m2 <- lm(mpg ~ wt + hp + cyl, data = mtcars)
  p <- bcat_plt_coef(list("Base" = m1, "Extended" = m2))
  expect_true(inherits(p, "ggplot"))
})

test_that("bcat_plt_coef respects intercept = TRUE", {
  m <- lm(mpg ~ wt, data = mtcars)
  p <- bcat_plt_coef(m, intercept = TRUE)
  expect_true(inherits(p, "ggplot"))
})

Try the Rbearcat package in your browser

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

Rbearcat documentation built on March 21, 2026, 5:07 p.m.