tests/testthat/test_generate_splits.R

# --------------------------------------------------
# Test Script - Error for generate_subsets Function
# --------------------------------------------------

# Required libraries
library(splitSelect)

# Context of test script
context("Verify generation of all possible splits.")

# There should be an error if we want to compute the IF TS, and no returns are provided
test_that("Error for the \"generate_splits\" function. Unequal number of possible splits.", {
  
  # Number of variables
  p <- 8
  # Number of groups
  G <- 4:5
  expect_equal(sum(nsplit(p,G)), nrow(generate_splits(p, G)))
})

Try the splitSelect package in your browser

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

splitSelect documentation built on Nov. 9, 2021, 9:07 a.m.