tests/testthat/test-MoransI.R

test_that("Moran's I works", {
  TestMat <- matrix(c(1, 0, 1, 0, 1,
                      0, 1, 0, 1, 0,
                      1, 0, 1, 0, 1,
                      0, 1, 0, 1, 0,
                      1, 0, 1, 0, 1),
                    nrow =5)
  MoransI(TestMat, r1 = 1)
  expect_equal(round(MoransI(TestMat, r1 = 1), 3), -1)
})
goodsman/ICvectorfields documentation built on March 19, 2022, 6:15 p.m.