tests/testthat/test-numeric_blurer.R

test_that("numeric blur", {
  .fn <- numeric_blur.f(c(-2, 2)) 
  
  expect_equal(class(.fn), "function")
  
  result <- .fn(-10:10)
  
  expect_equal(class(result), "factor")

  expect_equal(levels(result), c("(-Inf,-2]", "(-2,2]", "(2, Inf]"))
})

Try the deident package in your browser

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

deident documentation built on April 3, 2025, 6:14 p.m.