tests/testthat/test-resample2.R

context("test-resample2")

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

  new_wav <- c(1650, 2165, 2205, 2260, 2330, 2395)
  fwhm <- c(100, 40, 40, 50, 70, 70)
  X_resample <- resample2(
    NIRsoil$spc, as.numeric(colnames(NIRsoil$spc)),
    new_wav, fwhm
  )

  expect_is(X_resample, "matrix")

  expect_true(round(max(abs(X_resample[1, ])), 5) == 0.34966)
})

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.