tests/testthat/test-roundPropCategorical.R

test_that("rounds appropriately", {
  set.seed(42)
  res <- roundPropCategorical(runif(100) * 100)
  expect_equal(mean(res), 1)
  expect_equal(sd(res), 30.197, tolerance = 0.001)
})
Crunch-io/crunchtabs documentation built on Jan. 31, 2023, 12:14 p.m.