# We build a simple example config
my_config <- config(
cycle = life_cycle(
transition("a", "b", function() 0.1, "probability"),
transition("b", "a", function() 10, "probability")
),
initial_population = c(a = 1)
)
# If we make a change to an existing `config`, it is a good idea to check
# whether it is still valid by calling `config()` on it again. For example,
# here we set the initial_population of a life stage that is not included in
# the life cycle.
my_config$initial_population <- c(a = 1, c = 1)
if (FALSE) {
# Now, we re-run the validations, which will throw an error
do.call(config, my_config)
}
Run the code above in your browser using DataLab