# ---------------------------------------------------------------------------- #
test_that("is_invertible works as expected for invertible matrix", {
x <- matrix(c(1, 2, 2, 1), 2, 2)
expect_true(is_invertible(x))
})
# ---------------------------------------------------------------------------- #
test_that("is_invertible fails for singular matrix", {
x <- matrix(c(1, 1, 1, 1), 2, 2)
expect_false(is_invertible(x))
})
# ---------------------------------------------------------------------------- #
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.