This function adjusts the size grid in a MizerParams object to the desired minimum and maximum size. It can both expand and truncate the grid. If the grid is truncated, any data outside the new grid is discarded. A warning is issued if there is non-negligible biomass in the discarded size bins.
adjustSizeGrid(params, ...)# S3 method for MizerParams
adjustSizeGrid(
params,
new_min_w = min(params@species_params$w_min),
new_max_w = max(params@species_params$w_max),
new_min_w_pp = min(params@w_full),
preserve_species = params@species_params$species,
tol = 1e-06,
...
)
A new MizerParams object with the updated size grid.
A MizerParams object.
Additional arguments.
The new minimum size in the grid. Defaults to the minimum egg size of all species.
The new maximum size in the grid. Defaults to the maximum asymptotic size of all species.
The new minimum size of the resource spectrum. Defaults
to the current minimum of w_full.
A vector of species names for which all rate arrays should be copied over to the new params object rather than being re-calculated from the species parameters. If missing, all species are preserved.
A numeric value specifying the tolerance for truncation losses.
The following checks are made separately for each species and a warning is
raised, listing the affected species, if the lost fraction exceeds this
value for any of them: the fraction of the species' biomass lost, the
fraction of the diet of the smallest individuals of the species lost to
resource truncation, and the fraction of the diet of the largest
individuals of the species lost to resource truncation. Defaults to
1e-6.