tests/testthat/helper-parse.R

## When creating test cases for the parser, we need to create model
## systems that include initial() and deriv()/update() calls
ex <- function(x, discrete = FALSE, var = "q") {
  rhs <- if (discrete) "update" else "deriv"
  sprintf("%s\ninitial(%s) <- 1\n%s(%s) <- 1", x, var, rhs, var)
}

Try the odin package in your browser

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

odin documentation built on Oct. 2, 2023, 5:07 p.m.