tests/testthat/test-winsorize.R

winsorized <- winsorize(1:100, prob = 0.05)

test_that("winsorize works", {
  expect_equal(min(winsorized, na.rm = TRUE), 5.5)
})

test_that("winsorize works", {
  expect_equal(max(winsorized, na.rm = TRUE), 95.5)
})

Try the farr package in your browser

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

farr documentation built on Feb. 16, 2023, 8:11 p.m.