tests/testthat/test_grouping.R

test_that("number of elements in each group should differ by at most 1", {
    check_uniform_groups <- function(groups){
        diff(range(table(groups))) <= 1
    }

 	groups <- groups_by_filter(runif(1000),7)
	expect_true(check_uniform_groups(groups))
})
nignatiadis/IHW documentation built on Aug. 22, 2023, 2:11 p.m.