Verify that a compartment would be new to the model
Examples
# \donttest{
mod <- function() {
ini({
tcl <- log(3)
tv <- log(30)
})
model({
cl <- exp(tcl)
v <- exp(tv)
d/dt(central) <- -cl / v * central
})
}
assertCompartmentNew(mod, "peripheral")
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
try(assertCompartmentNew(mod, "central")) # already a compartment
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#> Error : compartment 'central' already exists in the model
# }
