tests/testthat/test-absmax.R

context("Finding absolute maximums")

test_that("absmax finds the absolute maximum", {
  expect_equal(absmax(c(5, 3, -9, -100, 3.14159, 7.5)), 100)
})

test_that("absmax ignores NA values", {
  expect_equal(absmax(c(5, 3, NA, -9, NA, 200, NA), na.rm = TRUE), 200)
})

Try the nima package in your browser

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

nima documentation built on March 13, 2020, 2:10 a.m.