tests/testthat/test-calc_mode_numeric.R

test_that("calc_mode_numeric returns the correct mode", {
  result <- calc_mode_numeric(
    x = c(1, 1, 1, 2, 3)
  )
  expect_equal(result, 1)
})

test_that("calc_mode_numeric returns the lowest mode for multi-modal vectors", {
  result <- calc_mode_numeric(
    x = c(1, 1, 2, 2)
  )
  expect_equal(result, 1)
})

test_that("calc_mode_numeric returns the lowest mode for multi-modal vectors", {
  result <- calc_mode_numeric(
    x = c(1, 1, 2, 2, 3, 3)
  )
  expect_equal(result, 1)
})

Try the eventreport package in your browser

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

eventreport documentation built on March 11, 2026, 1:07 a.m.