tests/testthat/test-savitzkyGolay.R

context("test-savitzkyGolay")

test_that("savitzkyGolay works", {
  nirdata <- data("NIRsoil")

  X_savitzkyGolay <- savitzkyGolay(NIRsoil$spc, m = 1, p = 1, w = 3)

  expect_is(X_savitzkyGolay, "matrix")
  expect_true(round(max(abs(X_savitzkyGolay[1, ])), 5) == 0.00528)
})

Try the prospectr package in your browser

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

prospectr documentation built on June 22, 2024, 11:08 a.m.