tests/testit/test-developer-fastlag.R

assert("internal function fastlag() produces expected results", {
  observed <- fastlag(1:5, first = 100)
  expected <- c(100, 1:4)
  (observed %==% expected)

  # can also work with list()
  observed <- fastlag(list(1, 2, 3, 4, 5), first = 100)
  expected <- list(100, 1, 2, 3, 4)
  (observed %==% expected)
})

Try the gsDesign2 package in your browser

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

gsDesign2 documentation built on July 1, 2026, 1:08 a.m.