tests/testthat/test_stasis.R

test_that("throws error for negative sd", {
  expect_error(stasis(c(1,2), mean = 1, sd = - 0.1))
})

test_that("returns constant for sd of 0",{
  sd = 0
  t = seq(0, 1, by = 0.1)
  mean = 0
  st = stasis(t, mean, sd)
  expect_equal(rep(mean, length(t)), st$y)
})

Try the StratPal package in your browser

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

StratPal documentation built on Dec. 6, 2025, 5:08 p.m.