tests/testthat/test-check_variables.R

context("Function inputs")
test_that("Variables check", {

  # This should produce no error messages
  expect_equal(check_variables(matrix(c(1, 2, 3, 4), ncol=2), "test matrix"), expected=TRUE)

  # This should produce non-numeric data error message
  expect_error(check_variables(matrix(as.character(c(1, 2, 3, 4)), ncol=2), "test matrix"))

  # These should produce non-finite data error message
  expect_error(check_variables(matrix(c(1, 2, NA, 4), ncol=2), "test matrix"))
  expect_error(check_variables(matrix(c(1, 2, Inf, 4), ncol=2), "test matrix"))
})

Try the TriDimRegression package in your browser

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

TriDimRegression documentation built on Sept. 13, 2023, 5:07 p.m.