tests/testthat/test-outbreak.R

context("Outbreak")
library(dfoliatR)

data("efk_obr")

test_obr <- outbreak(efk_defol)

obr_stats <- outbreak_stats(test_obr)

test_that("outbreak consistently defines outbreaks", {
  expect_equal(efk_obr$outbreak_status, test_obr$outbreak_status)
})

test_that("outbreak_stats gets the same first interval", {
  expect_equivalent(data.frame(1788, 1796), obr_stats[1, 1:2])
})

test_that("outbreak stats finds the same number of events", {
  expect_equal(nrow(obr_stats), 10)
})

Try the dfoliatR package in your browser

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

dfoliatR documentation built on Aug. 10, 2023, 1:08 a.m.