tests/testthat/test-calculateVarExp.R

test_that("The function works when there are no NAs in the cube", {
  X = Fujita2023$data
  model = multiway::parafac(X, nfac=1, nstart=1, verbose=FALSE)
  expect_no_error(calculateVarExp(model, X))
})

test_that("The function works when there are NAs in the cube", {
  X = Shao2019$data
  model = multiway::parafac(X, nfac=1, nstart=1, verbose=FALSE)
  expect_no_error(calculateVarExp(model, X))
})

Try the parafac4microbiome package in your browser

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

parafac4microbiome documentation built on June 8, 2025, 11:40 a.m.