tests/testthat/test_input_data.R

# -----------------------------------------
# Test Script - Error for Input Data
# -----------------------------------------

# Required libraries
library(RPEGLMEN)

# Context of test script
context("Verify input for functions.")

# There should be an error if we want to compute the IF TS, and no returns are provided
test_that("Error for invalid input data", {
  expect_error(glmnet_exp())
  expect_error(glmnet_exp(A=rnorm(10), b=rnorm(10)))
  expect_error(glmnet_exp(A=matrix(rnorm(10), nrow=2), b=matrix(rnorm(10), nrow=2)))
  expect_error(fit.glmGammaNet())
  expect_error(fit.glmGammaNet(A=rnorm(10), b=rnorm(10)))
  expect_error(fit.glmGammaNet(A=matrix(rnorm(10), nrow=2), b=matrix(rnorm(10), nrow=2)))
})

Try the RPEGLMEN package in your browser

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

RPEGLMEN documentation built on May 14, 2021, 1:08 a.m.