tests/testthat/test-signal.R

test_that("signal", {
  set.seed(333)

  x <- sin(seq(0, 4 * pi, length.out = 100)) + rnorm(100, 0, 0.2)
  s1 <- as.vector(smoothing(x, method = "loess"))
  s2 <- as.vector(smoothing(x, method = "smooth"))

  expect_true(as.numeric(datawizard::smoothness(s1)) > as.numeric(datawizard::smoothness(s2)))
})

Try the modelbased package in your browser

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

modelbased documentation built on June 22, 2024, 10:46 a.m.