View source: R/rate_functions.R
| getPredRate | R Documentation |
Calculates the potential rate (in units 1/year) at which a prey individual of
a given size w is killed by predators from species j. In formulas
{\tt pred\_rate}_j(w_p) = \int \phi_j(w,w_p) (1-f_j(w))
\gamma_j(w) N_j(w) \, dw.
This potential rate is used in getPredMort() to
calculate the realised predation mortality rate on the prey individual.
getPredRate(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 (predator species x prey
size), where the prey size runs over fish community plus resource spectrum.
MizerSim: An ArrayTimeBySpeciesBySize object (time step x predator
species x prey size) with the predation rates at every time step.
If drop = TRUE then dimensions of length 1 will be removed.
By default getPredRate() calls mizerPredRate(). However you can
replace this with your own alternative predation rate function. If
your function is called "myPredRate" then you register it in a MizerParams
object params with
params <- setRateFunction(params, "PredRate", "myPredRate")
Your function will then be called instead of mizerPredRate(), with
the same arguments.
Other rate functions:
getDiffusion(),
getEGrowth(),
getERepro(),
getEReproAndGrowth(),
getEncounter(),
getFMort(),
getFMortGear(),
getFeedingLevel(),
getFlux(),
getFluxGradient(),
getMort(),
getPredMort(),
getRDD(),
getRDI(),
getRates(),
getResourceMort()
params <- NS_params
# Predation rate in initial state
pred_rate <- getPredRate(params)
str(pred_rate)
# With constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get the feeding level at one time step
pred_rate <- getPredRate(params, n = N(sim)[15, , ],
n_pp = NResource(sim)[15, ], t = 15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.