tests/testthat/test-calc_mode_binary.R

test_that("calc_mode_binary returns the correct mode value", {
  result <- calc_mode_binary(
    x = c(0, 0, 1, 1, 1)
  )
  expect_equal(result, 1)
})

test_that("calc_mode_binary returns the highest mode value when there are multiple modes", {
  result <- calc_mode_binary(
    x = c(0, 0, 1, 1)
  )
  expect_equal(result, 1)
})

test_that("calc_mode_binary returns the correct mode value", {
  result <- calc_mode_binary(
    x = c(0, 0, 0, 1, 1)
  )
  expect_equal(result, 0)
})

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.