tests/testthat/test-mix_matrices.R

library(AnthropMMD)

### Generate artifical matrices:
m <- matrix(1:9, ncol = 3, nrow = 3)
n <- matrix(10:18, ncol = 3, nrow = 3)
res <- matrix(c(5, 11, 12, 4, 5, 15, 7, 8, 5),
              ncol = 3, nrow = 3)

## Test:
test_that("mix_matrices gives correct answer", {
  expect_equal(mix_matrices(m, n, diag_value = 5), res)
})

Try the AnthropMMD package in your browser

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

AnthropMMD documentation built on Aug. 8, 2023, 5:12 p.m.