tests/testthat/test_ginv.R

library(testthat)

context("Test matrix inversion")

test_that("Matrix inversion gives acceptable result", {
 
  mata <- matrix(c(2,1,1,0), nrow = 2, ncol = 2, byrow = T)
  matb <- matrix(c(0,1,1,-2), nrow = 2, ncol = 2, byrow = T)
  
  expect_equal(ginv(mata), matb)
  
})

Try the icarus package in your browser

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

icarus documentation built on Sept. 9, 2025, 5:43 p.m.