tests/testthat/test-leaps.R

context("lmtest")

skip_on_cran()

skip_if_not_installed("modeltests")
library(modeltests)

skip_if_not_installed("leaps")

test_that("tidy.regsubsets", {
  check_arguments(tidy.regsubsets)

  all_fits <- leaps::regsubsets(hp ~ ., mtcars)
  td <- tidy(all_fits)

  # column names are essentially those for glance,
  # also column names from training data sneak through,
  # so strict tests will fail
  check_tidy_output(td, strict = FALSE)
})
tidyverse/broom documentation built on March 24, 2024, 11:09 a.m.