View source: R/rate_functions.R
| getPredMort | R Documentation |
Calculates the total predation mortality rate \mu_{p,i}(w_p) (in units
of 1/year) on each prey species by prey size:
\mu_{p.i}(w_p) = \sum_j {\tt pred\_rate}_j(w_p)\, \theta_{ji}.
The predation rate pred_rate is returned by getPredRate().
getPredMort(object, ...)
object |
A MizerParams or MizerSim object. |
... |
Additional arguments that depend on the class of For a MizerParams object:
For a MizerSim object:
|
MizerParams: An ArraySpeciesBySize object (prey species x prey size)
with the predation mortality rates.
MizerSim: An ArrayTimeBySpeciesBySize object (time step x prey species
x prey size) with the predation mortality at every time step.
If drop = TRUE then dimensions of length 1 will be removed.
By default getPredMort() calls mizerPredMort(). However you can
replace this with your own alternative predation mortality function. If
your function is called "myPredMort" then you register it in a MizerParams
object params with
params <- setRateFunction(params, "PredMort", "myPredMort")
Your function will then be called instead of mizerPredMort(), with the
same arguments.
Other rate functions:
getDiffusion(),
getEGrowth(),
getERepro(),
getEReproAndGrowth(),
getEncounter(),
getFMort(),
getFMortGear(),
getFeedingLevel(),
getFlux(),
getFluxGradient(),
getMort(),
getPredRate(),
getRDD(),
getRDI(),
getRates(),
getResourceMort()
params <- NS_params
# Predation mortality in initial state
M2 <- getPredMort(params)
str(M2)
# With constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get predation mortality at one time step
M2 <- getPredMort(params, n = N(sim)[15, , ], n_pp = NResource(sim)[15, ])
# Get predation mortality at all saved time steps
M2 <- getPredMort(sim)
str(M2)
# Get predation mortality over the years 15 - 20
M2 <- getPredMort(sim, time_range = c(15, 20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.