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))
})

Try the IHW package in your browser

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

IHW documentation built on Nov. 8, 2020, 7:44 p.m.