| run_strat {SimSurvey} | R Documentation |
Run stratified analysis on simulated data
Description
Run stratified analysis on simulated data
Usage
run_strat(
sim,
length_group = "inherit",
alk_scale = "division",
strat_data_fun = strat_data,
strat_means_fun = strat_means
)
Arguments
sim |
Simulation from |
length_group |
Size of the length frequency bins for both abundance at length calculations
and age-length-key construction. By default this value is inherited from
the value defined in |
alk_scale |
Spatial scale at which to construct and apply age-length-keys: "division" or "strat". |
strat_data_fun |
Function for preparing data for stratified analysis (e.g. |
strat_means_fun |
Function for calculating stratified means (e.g. |
Details
The "strat_data_fun" and "strat_means_fun" allow the use of custom
strat_data and strat_means functions.
Value
Adds stratified analysis results for the total population ("total_strat")
and the population aggregated by length group and age ("length_strat" and
"age_strat", respectively) to the sim list.
Examples
sim <- sim_abundance(ages = 1:5, years = 1:5,
R = sim_R(log_mean = log(1e+7)),
growth = sim_vonB(length_group = 1)) %>%
sim_distribution(grid = make_grid(res = c(20, 20)),
ays_covar = sim_ays_covar(sd = 1)) %>%
sim_survey(n_sims = 1, q = sim_logistic(k = 2, x0 = 3)) %>%
run_strat()