tests/testthat/test-coercion.R

test_that("as.data.frame coercion works", {
    dates <- Sys.Date() + 1:10
    expected <- data.frame(date_index = dates, count_variable = "dates", count = 1L)
    x <- incidence(data.frame(dates), date_index = "dates")
    expect_identical(as.data.frame(x), expected)
})

Try the incidence2 package in your browser

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

incidence2 documentation built on July 9, 2023, 5:35 p.m.