tests/testthat/test-whatif_convexhull.R

test_that("REQUIRE TEST whatif with 1 counterfactual", {
    skip_on_cran()
    
    my.cfact <- matrix(rnorm(3*5), ncol = 5)
    my.data <- matrix(rnorm(100*5), ncol = 5)
    
    expect_error(whatif(data = my.data, cfact = matrix(my.cfact[1,], nrow = 1), 
                        mc.cores = 1), NA) 
})


test_that("REQUIRE TEST multithreaded", {
    skip_on_cran()

    my.cfact <- matrix(rnorm(3*5), ncol = 5)
    my.data <- matrix(rnorm(100*5), ncol = 5)

    expect_error(whatif(data = my.data, cfact = my.cfact,
                        mc.cores = 1), NA)
})

Try the WhatIf package in your browser

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

WhatIf documentation built on March 26, 2026, 1:06 a.m.