tests/testthat/test-trigonometric.R

context("trigonometric")

test_that("discrete Fourier transform matrix is correct", {
  set.seed(987)
  testMatrix <- matrix(sample(1:10, size = 25, replace = TRUE), nrow = 5)
  D <- dftMatrix(5)
  fftTrans <- D %*% testMatrix
  
  expect_equal(fftTrans, apply(testMatrix, MARGIN = 2, FUN = fft))
  }
)

Try the mrbsizeR package in your browser

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

mrbsizeR documentation built on May 29, 2024, 5:45 a.m.