tests/testthat/test-col-stats.R

test_that("mean_cols works", {
  m <- matrix(sample.int(100), ncol = 20)
  expect_equal(mean_cols(m), apply(m, 2, mean))
})

test_that("brightness_cols edge case works", {
  expect_equal(
    brightness_cols(matrix(numeric(0), ncol = 7)),
    rep(NaN, 7)
  )
})
rorynolan/detrendr documentation built on March 9, 2023, 10:26 p.m.