Learn R Programming

mizer (version 3.0.0)

getEReproAndGrowth: Get energy rate available for reproduction and growth

Description

Calculates the energy rate \(E_{r.i}(w)\) (grams/year) available for reproduction and growth after metabolism and movement have been accounted for.

Usage

getEReproAndGrowth(object, ...)

Value

  • MizerParams: An ArraySpeciesBySize object (species x size) with the energy rate \(E_{r.i}(w)\) available for growth and reproduction (grams/year).

  • MizerSim: An ArrayTimeBySpeciesBySize object (time step x species x size) with the energy rate at every time step. If drop = TRUE then dimensions of length 1 will be removed.

Arguments

object

A MizerParams or MizerSim object.

...

Additional arguments that depend on the class of object.

For a MizerParams object:

n

A matrix of species abundances (species x size). Defaults to the initial abundances stored in object.

n_pp

A vector of the resource abundance by size. Defaults to the initial resource abundance stored in object.

n_other

A named list of the abundances of other dynamical components. Defaults to the initial values stored in object.

t

The time for which to do the calculation. Defaults to 0.

For a MizerSim object:

time_range

The time range over which to return the rates. Either a vector of values, a vector of min and max time, or a single value. Defaults to the whole time range of the simulation.

drop

If TRUE then any dimension of length 1 is removed from the returned array.

Your own energy rate function

By default getEReproAndGrowth() calls mizerEReproAndGrowth(). However you can replace this with your own alternative energy rate function. If your function is called "myEReproAndGrowth" then you register it in a MizerParams object params with

params <- setRateFunction(params, "EReproAndGrowth", "myEReproAndGrowth")

Your function will then be called instead of mizerEReproAndGrowth(), with the same arguments.

See Also

The part of this energy rate that is invested into growth is calculated with getEGrowth() and the part that is invested into reproduction is calculated with getERepro().

Other rate functions: getDiffusion(), getEGrowth(), getERepro(), getEncounter(), getFMort(), getFMortGear(), getFeedingLevel(), getFlux(), getMort(), getPredMort(), getPredRate(), getRDD(), getRDI(), getRates(), getResourceMort()

Examples

Run this code
# \donttest{
params <- NS_params
# Project with constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get the energy at a particular time step
e <- getEReproAndGrowth(params, n = N(sim)[15, , ],
                        n_pp = NResource(sim)[15, ], t = 15)
# Rate at this time for Sprat of size 2g
e["Sprat", "2"]
# }

Run the code above in your browser using DataLab