tests/testthat/test-htd.R

test_that("htd works", {

  x <- rnorm(600, mean = 50, sd = 6.3)
  date <- seq.Date(as.Date("2022-01-01"), by = "day", length.out = 600)
  df <- data.frame(date, x)

  expect_identical(htd(df, "2022-01-01", x = "x"), dday(df, "2022-01-01", x = "x"))
  expect_identical(htd(df, "2023-01-25", x = "x"), mtd(df, "2023-01-25", x = "x"))
  expect_identical(htd(df, "2023-03-04", x = "x"), qtd(df, "2023-03-04", x = "x"))

  })

Try the iperform package in your browser

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

iperform documentation built on May 29, 2024, 3:19 a.m.