getM2 | R Documentation |
Calculates the total predation mortality \mu_{p,i}(w_p)
on each prey
species by prey size. This method is used by the project_therMizer
method
for performing simulations.
getM2
method for therMizerParams
object with pred_rate
argument.
getM2
method for therMizerSim
object.
getM2(object, n, n_pp, ocean_temp, phi_prey, feeding_level, pred_rate, ...)
## S4 method for signature
## 'therMizerParams,matrix,numeric,numeric,matrix,matrix,array'
getM2(object,
n, n_pp, ocean_temp, phi_prey, feeding_level, pred_rate)
## S4 method for signature
## 'therMizerSim,missing,missing,missing,missing,missing,missing'
getM2(object,
ocean_temp, time_range = dimnames(object@ocean_temp)$time, drop = TRUE,
...)
object |
A |
n |
A matrix of species abundance (species x size). Only used if
|
n_pp |
A vector of the background abundance by size. Only used if
|
ocean_temp |
A numeric vector of the ocean temperature by realm or a single numeric ocean_temp value which is used for all realms. |
pred_rate |
An array of predation rates of dimension no. sp x no.
community size bins x no. of size bins in whole spectra (i.e. community +
background, the w_full slot). The array is optional. If it is not provided
it is calculated by the |
... |
Other arguments (currently unused). |
time_range |
Subset the returned fishing mortalities by time. The time
range is either a vector of values, a vector of min and max time, or a
single value. Default is the whole time range. Only used if the
|
drop |
Only used when object is of type |
If a therMizerParams
object is passed in, the method returns a two
dimensional array (prey species x prey size) based on the abundances also
passed in. If a therMizerSim
object is passed in, the method returns a
three dimensional array (time step x prey species x prey size) with the
predation mortality calculated at every time step in the simulation.
getPredRate
and project_therMizer
.
## Not run:
data(NS_species_params_gears)
data(inter)
params <- therMizerParams(NS_species_params_gears, inter)
# With constant fishing effort for all gears for 20 time steps
sim <- project_therMizer(params, t_max = 20, effort = 0.5)
# Get M2 at one time step
n <- sim@n[21,,]
n_pp <- sim@n_pp[21,]
getM2(params,n,n_pp)
# Get M2 at all saved time steps
getM2(sim)
# Get M2 over the time 15 - 20
getM2(sim, time_range = c(15,20))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.