tests/testthat/test-smooth-mortality-law.R

test_that("smooth_mortality_law", {
  sm <- norway_mortality |>
    dplyr::filter(Year <= 1910, Sex == "Male") |>
    smooth_mortality_law(Mortality)
  expect_identical(dim(sm), c(1221L, 9L))
  expect_no_error(autoplot(sm, .smooth) + ggplot2::scale_y_log10())
})

Try the vital package in your browser

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

vital documentation built on Aug. 21, 2025, 5:34 p.m.