tests/testthat/test_sexrelation_calculations.R

test_that("life.table sexrelation does the mathing correctly", {
  # dx
  expect_true(
    dplyr::near(
      single_life_table$dx,
      schleswig_ma$dx/10,
      tol = 0.1
    ) %>% all
  )
  # lx
  expect_true(
    dplyr::near(
      single_life_table$lx,
      schleswig_ma$lx/10,
      tol = 0.1
    ) %>% all
  )
})

Try the mortAAR package in your browser

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

mortAAR documentation built on Aug. 28, 2023, 1:06 a.m.