tests/testthat/test-zoo_time.R

test_that("`zoo_time()` works", {
  x <- zoo_simulate(rows = 150, time_range = c(
    Sys.Date() - 365,
    Sys.Date()
  ), irregular = TRUE, seed = 1)

  df <- zoo_time(x = x)

  expect_equal(class(df), "data.frame")
  expect_true(all(colnames(df) %in% c("name", "rows", "class", "units", "length", "resolution", "begin", "end", "keywords")))
})

Try the distantia package in your browser

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

distantia documentation built on April 4, 2025, 5:42 a.m.