tests/testthat/test-round_preserve_sum.R

testthat::test_that("unrowwise() works", {
  v <- c(1 / 3, 1 / 3, 1 / 3)
  expect_equal(
    sum(v),
    sum(round_preserve_sum(v, digits = 1))
  )
})

Try the guideR package in your browser

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

guideR documentation built on June 8, 2025, noon