tests/testthat/test-filters.R

test_that("meanFilter returns the mean", {
  expect_equal(meanFilter(c(1, 2, 3, 4, 5, 6, 7), n = 5), c(NA, NA, 3, 4, 5, NA, NA))
  expect_equal(meanFilter(c(1, 1, 1, 1, 1, 1, 1), n = 5), c(NA, NA, 1, 1, 1, NA, NA))
  expect_equal(meanFilter(c(1, 1, 1, 1, 1, 1, 1), n = 3), c(NA, 1, 1, 1, 1, 1, NA))
})

Try the topdowntimeratio package in your browser

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

topdowntimeratio documentation built on Sept. 22, 2022, 9:07 a.m.