Tidy long-format derived quantities from an Rceattle fit
Source:R/0-rceattle_class.R
as.data.frame.Rceattle.RdReturns the model's derived population quantities in long form so that
custom plots and post-processing don't have to walk the deeply nested
quantities list or inherit the dimnames decisions in
rename_output(). Two shapes are flattened into one tidy frame:
species-by-year quantities (e.g. biomass, ssb, R, F_spp) and
species-by-sex-by-age-by-year quantities (e.g. N_at_age,
biomass_at_age, M_at_age). For the species-level shapes, sex
and age are returned as NA. Cells of the 4D arrays that are
padded out to max(nsex) / max(nages) for species with fewer
sexes or ages are dropped.
Usage
# S3 method for class 'Rceattle'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
which = c("biomass", "ssb", "R", "biomass_depletion", "ssb_depletion", "F_spp"),
ci_level = 0.95,
...
)Arguments
- x
An object of class
"Rceattle"returned byfit_mod().- row.names, optional
Ignored; present for the
as.data.frame()generic.- which
Character vector of quantity names to extract, or
"all"for every quantity with a known shape. Defaults to a common population-level summary. Seenames(Rceattle:::.RCEATTLE_QUANTITIES)for the full list.- ci_level
Confidence level for
lwrandupr. Default0.95.- ...
Currently unused.