getFeedingLevel | R Documentation |
Calculates the amount of food f_i(w)
consumed by a predator by predator
size based on food availability, search volume and maximum intake. This
method is used by the project_therMizer
method for performing
simulations.
getFeedingLevel method for a therMizerParams
object with already calculated phi_prey
matrix.
getFeedingLevel method for a therMizerSim
object.
getFeedingLevel(object, n, n_pp, ocean_temp, phi_prey, ...)
## S4 method for signature 'therMizerParams,matrix,numeric,numeric,matrix'
getFeedingLevel(object,
n, n_pp, ocean_temp, phi_prey, ...)
## S4 method for signature 'therMizerSim,missing,missing,missing,missing'
getFeedingLevel(object,
ocean_temp, time_range = dimnames(object@ocean_temp)$time, drop = FALSE,
...)
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 vectory of the ocean temperature by realm or a single numeric temperature value which is used for all realms. |
phi_prey |
The PhiPrey matrix (optional) of dimension no. species x no.
size bins. If not passed in, it is calculated internally using 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 |
should extra dimensions of length 1 in the output be dropped, simplifying the output. Defaults to TRUE. |
If a therMizerParams
object is passed in, the method returns a two
dimensional array (predator species x predator 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 predator species x predator size) with the
feeding level calculated at every time step in the simulation.
getPhiPrey
## 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 the feeding level at one time step
n <- sim@n[21,,]
n_pp <- sim@n_pp[21,]
fl <- getFeedingLevel(params,n,n_pp)
# Get the feeding level at all saved time steps
fl <- getFeedingLevel(sim)
# Get the feeding level for time 15 - 20
fl <- getFeedingLevel(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.