Open lentinj opened 1 month ago
in the 3 species model https://github.com/vbartolino/g3_GoB/blob/main/rin_ven_her_g3/gadget3/02-setup/setup.R that seems to work. Is that a special case or I was overoptimistic about that run?
## collate the seal actions
actions_rin <- c(
stock_actions,
fleet_actions,
likelihood_actions,
time_actions,
NULL
)
...
## collate the vendace actions
actions_ven <- c(
stock_actions,
fleet_actions,
likelihood_actions,
time_actions,
NULL
)
...
## collate both actions together
actions <- c(actions_rin,
actions_ven,
NULL)
No, that's absolutely fine and you've done it right. Each actions variable in your code sample is a list, so c()
is just concatenating lists.
The problem comes when you try and concatenate an action to a list. For instance here:
The temptation is to do:
# Wrong!
simple_fn <- g3_to_r(c(simple_actions, g3a_report_detail(simple_actions) ))
We could make the above work, or we could error if you get it wrong. I'm not decided on the best approach yet.
c(g3a_x(), list(g3a_x()))
results in a silent mess. Either:g3_collate()
, and not worry about itc.g3_action
, catch this and complain.