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)
  )
})

Try the detrendr package in your browser

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

detrendr documentation built on March 7, 2023, 7:52 p.m.