tests/testthat/test-check_if_valid_contrmat.R

test_that("Error messages for valid contrast matrix work", {
  expect_error(.is_valid_contrmat(matrix(c(1, 1, 1, 1, 1, 1), nrow = 3)),
    regexp = "is invalid for contrasts"
  )
  expect_error(.is_valid_contrmat(orth_polynomial_code(5)[, -1]),
               regexp = "invalid size")
})

Try the contrastable package in your browser

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

contrastable documentation built on Oct. 1, 2024, 5:07 p.m.