Assert a variable would be new to the model
Examples
# \donttest{
mod <- function() {
ini({
tcl <- log(3)
tv <- log(30)
add.sd <- 0.7
})
model({
cl <- exp(tcl)
v <- exp(tv)
d/dt(central) <- -cl / v * central
cp <- central / v
cp ~ add(add.sd)
})
}
assertVariableNew(mod, "kel")
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
try(assertVariableNew(mod, "cp")) # already in the model
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> Error : variable 'cp' is already in the model
# }
