tests/testthat/test-ei.R

context("Testing E-I index")


test_that("E-I index returns correct value for Catania data", {
          p <- Catania / sum(Catania)
          int <- sum(diag(p))
          ext <- 1 - int
          tv <- ext - int
          v <- ei(Catania)
          expect_equal(v, tv)
} )
mbojan/isnar documentation built on Feb. 18, 2021, 4:38 a.m.