tests/testthat/test.thin.R

context("thin")
test_that("thin", {
  d <- 1
  t <- .2
  set.seed(234)
  x <- cumsum(c(rgamma(100, 10, 10), 1, .1, 1, .1, 1.03, .8, 12, 1.2, 234, .2, .8, .33, 5, .8, 5, 1.2, 77, 1, .1, 1, .1, 33))
  selType <- "first"
  expect_equal(move:::filterThinFun(x, d, t, selType), move:::filterThinFun2(x, d, t, selType))
  selType <- "closest"
  expect_equal(move:::filterThinFun(x, d, t, selType), move:::filterThinFun2(x, d, t, selType))
  selType <- "all"
  expect_equal(move:::filterThinFun(x, d, t, selType), move:::filterThinFun2(x, d, t, selType))
  x <- cumsum(rep(3, 5))
  expect_equal(move:::filterThinFun(x, d, t, selType), move:::filterThinFun2(x, d, t, selType))
})

Try the move package in your browser

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

move documentation built on July 9, 2023, 6:09 p.m.