tests/testthat/test_1-7-0-Mode.R

test_that("Sparse ints", {
  x <- c(-.Machine$integer.max, 0L, 0L, .Machine$integer.max)
  expect_equal(Mode(x), 0L)
  x <- c(-.Machine$integer.max, 0L, 0L, NA, .Machine$integer.max)
  expect_equal(Mode(x), 0L)
})

Try the hutils package in your browser

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

hutils documentation built on April 13, 2022, 5:23 p.m.