Calculates the number of individuals within user-defined size limits, for each time and each species in the MizerSim object. The default option is to use the whole size range. You can specify minimum and maximum weight or lengths for the species. Lengths take precedence over weights (i.e. if both min_l and min_w are supplied, only min_l will be used)

getN(sim, ...)

## Arguments

sim An object of class MizerSim. Arguments passed on to get_size_range_array min_wSmallest weight in size range. Defaults to smallest weight in the model. max_wLargest weight in size range. Defaults to largest weight in the model. min_lSmallest length in size range. If supplied, this takes precedence over min_w. max_lLargest length in size range. If supplied, this takes precedence over max_w.

## Value

An array (time x species) containing the total numbers.

Other summary functions: getBiomass(), getDiet(), getGrowthCurves(), getSSB(), getYieldGear(), getYield()

## Examples

numbers <- getN(NS_sim)
numbers["1972", "Herring"]
#> [1] 1.49413e+11
# The above gave a huge number, because that included all the larvae.
# The number of Herrings between 10g and 1kg is much smaller.
numbers <- getN(NS_sim, min_w = 10, max_w = 1000)
numbers["1972", "Herring"]
#> [1] 4014916500