Learn R Programming

mizer (version 2.5.3)

getZ: Alias for getMort()

Description

[Deprecated] An alias provided for backward compatibility with mizer version <= 1.0

Usage

getZ(
  params,
  n = initialN(params),
  n_pp = initialNResource(params),
  n_other = initialNOther(params),
  effort = getInitialEffort(params),
  t = 0,
  ...
)

Value

A two dimensional array (prey species x prey size).

Arguments

params

A MizerParams object

n

A matrix of species abundances (species x size).

n_pp

A vector of the resource abundance by size

n_other

A list of abundances for other dynamical components of the ecosystem

effort

A numeric vector of the effort by gear or a single numeric effort value which is used for all gears.

t

The time for which to do the calculation (Not used by standard mizer rate functions but useful for extensions with time-dependent parameters.)

...

Unused

Your own mortality function

By default getMort() calls mizerMort(). However you can replace this with your own alternative mortality function. If your function is called "myMort" then you register it in a MizerParams object params with

params <- setRateFunction(params, "Mort", "myMort")

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

Details

If your model contains additional components that you added with setComponent() and for which you specified a mort_fun function then the mortality inflicted by these components will be included in the returned value.

See Also

getPredMort(), getFMort()

Other rate functions: getEGrowth(), getERepro(), getEReproAndGrowth(), getEncounter(), getFMort(), getFMortGear(), getFeedingLevel(), 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 total mortality at a particular time step
mort <- getMort(params, n = N(sim)[15, , ], n_pp = NResource(sim)[15, ], 
                t = 15, effort = 0.5)
# Mortality rate at this time for Sprat of size 2g
mort["Sprat", "2"]
# }

Run the code above in your browser using DataLab