Learn R Programming

mizer (version 1.0.1)

getM2Background: Get predation mortality rate for plankton

Description

Calculates the predation mortality rate \(\mu_p(w)\) on the plankton spectrum by plankton size. Used by the project method for running size based simulations.

Usage

getM2Background(object, n, n_pp, pred_rate)

# S4 method for MizerParams,matrix,numeric,array getM2Background(object, n, n_pp, pred_rate)

# S4 method for MizerParams,matrix,numeric,missing getM2Background(object, n, n_pp, pred_rate)

Arguments

object

A MizerParams object.

n

A matrix of species abundance (species x size).

n_pp

A vector of the background abundance by size.

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 getPredRate() method.

Value

A vector of predation mortalities by background prey size.

See Also

project and getM2.

Examples

Run this code
# NOT RUN {
data(NS_species_params_gears)
data(inter)
params <- MizerParams(NS_species_params_gears, inter)
# With constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get M2 of the background spectrum at one time step
n <- sim@n[21,,]
n_pp <- sim@n_pp[21,]
getM2Background(params,n,n_pp)
# }

Run the code above in your browser using DataLab