tests/testthat/test-signal.R

if (require("datawizard")) {
  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 Jan. 13, 2023, 9:12 a.m.