tests/testthat/test-stats.R

test_that("median2() works", {
  x <- runif(100)
  expect_equal(median2(x), median(x))
  expect_equal(
    median2(x, type = 3),
    quantile(x, type = 3, probs = .5, names = FALSE)
  )
})

test_that("range2() works", {
  x <- runif(100)
  expect_equal(range2(x), c(min(x), max(x)))
})

Try the mark package in your browser

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

mark documentation built on May 29, 2024, 5:13 a.m.