tests/testthat/test-utils_logic.R

test_that("if_any()", {
  expect_equal("first", if_any(TRUE, "first", "second"))
  expect_equal("first", if_any(c(FALSE, TRUE), "first", "second"))
  expect_equal("second", if_any(FALSE, "first", "second"))
  expect_equal("second", if_any(c(FALSE, FALSE), "first", "second"))
})

Try the pmrm package in your browser

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

pmrm documentation built on March 12, 2026, 5:07 p.m.