tests/testthat/test-zoo_smooth.R

test_that("`zoo_smooth()` works", {

  x <- zoo_simulate(cols = 1, seed = 1)

  x_smooth <- zoo_smooth_exponential(x = x, alpha = 0.2)

  expect_true(sd(x[, 1]) > sd(x_smooth[, 1]))

  x_smooth <- zoo_smooth_window(x = x)

  expect_true(sd(x[, 1]) > sd(x_smooth[, 1]))

})

Try the distantia package in your browser

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

distantia documentation built on April 4, 2025, 5:42 a.m.