Converts the nested list output of simmar into two tidy
tibbles: one for population state ($fauna) and one for fleet
outcomes ($fleets). This is the primary post-processing step before
plotting or analysis.
Arguments
- sim
Named list returned by
simmar. Step names should follow the"year_season"convention (with optional"step_"prefix, which is automatically stripped).- steps_to_keep
Character or integer vector of step names / indices to include in the output. Useful for reducing memory use when only the final years are needed. Default
NULLkeeps all steps.- time_step
Numeric. Fraction of a year per step (e.g.
0.25for quarterly seasons). WhenNULL, inferred from the step names insim(requires at least two steps).- keep_age
Logical. If
TRUE(default), return age-structured output. IfFALSE, aggregate across all ages before returning.
Value
A named list with two elements:
faunaTibble of population state; see Details.
fleetsTibble of fleet outcomes; see Details.
Details
Output columns
$fauna — one row per critter × patch × age × step:
critter: species namepatch: patch indexx,y: spatial coordinatesage: age class (numeric)mean_length: mean length at age (from life history)step: decimal year (e.g. 5.75 = year 5, season 4 of 4)n: numbers at ageb: biomass at agessb: spawning stock biomass at agec: catch in numbers at age
$fleets — one row per critter × patch × age × fleet × step:
critter,patch,x,y,age,fleet,step,mean_length: as abovecatch: catch in numbersrevenue: revenueeffort: effort unitscpue: catch per unit effort (NAwhere effort = 0)
When keep_age = FALSE, age classes are summed and a single
age = "all" row is returned per spatial unit per step.
Examples
if (FALSE) { # \dontrun{
sim <- simmar(fauna = fauna, fleets = fleets, years = 50)
# Full output (all steps, all ages)
proc <- process_marlin(sim, time_step = 1)
# Last 10 years only, aggregated across ages
last_steps <- tail(names(sim), 10)
proc_last <- process_marlin(sim,
steps_to_keep = last_steps,
time_step = 1,
keep_age = FALSE)
# Plot SSB over time
plot_marlin(proc, plot_var = "ssb", plot_type = "time")
} # }