tests/testthat/test-exploitation.R

test_that("exploitation", {
  expect_equal(ypr_exploitation(ypr_population(pi = 0.4)), 0.4)
  expect_equal(ypr_exploitation(ypr_population(pi = 0.4, rho = 0.6, Hm = 0.2)), 0.208)
  expect_equal(ypr_exploitation(ypr_population()), 0.2)
  expect_equal(ypr_exploitation(ypr_population(), 0.3), 0.3)
  expect_equal(ypr_exploitation(ypr_population(), numeric(0)), numeric(0))
  expect_equal(ypr_exploitation(ypr_population(), c(0.5, 0.6)), c(0.5, 0.6))
})

Try the ypr package in your browser

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

ypr documentation built on Aug. 30, 2022, 1:11 a.m.