tests/testthat/test-summary.collinear_selection.R

testthat::test_that("`summary.collinear_selection()` works", {
  testthat::skip_on_cran()

  data(
    vi_smol,
    vi_predictors_numeric
  )

  #normal usage
  x <- collinear(
    df = vi_smol,
    response = "vi_numeric",
    predictors = vi_predictors_numeric,
    quiet = TRUE
  )

  testthat::expect_output(
    z <- summary(x),
    regexp = "response"
  )

  testthat::expect_true(
    all(x$selection %in% z)
  )
})

Try the collinear package in your browser

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

collinear documentation built on Dec. 8, 2025, 5:06 p.m.