Learn R Programming

mizer (version 1.0.1)

getFMort: Get the total fishing mortality rate from all fishing gears by time, species and size.

Description

Calculates the total fishing mortality from all gears by species and size at each time step in the effort argument. The total fishing mortality is just the sum of the fishing mortalities imposed by each gear, \(\mu_{f.i}(w)=\sum_g F_{g,i,w}\).

Usage

getFMort(object, effort, ...)

# S4 method for MizerParams,numeric getFMort(object, effort, ...)

# S4 method for MizerParams,matrix getFMort(object, effort, ...)

# S4 method for MizerSim,missing getFMort(object, effort, time_range = dimnames(object@effort)$time, drop = TRUE, ...)

Arguments

object

A MizerParams object or a MizerSim object

effort

The effort of each fishing gear. Only needed if the object argument is of class MizerParams. See notes below.

...

Other arguments passed to getFMortGear method.

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 object argument is of type MizerSim.

drop

Only used when object is of type MizerSim. Should dimensions of length 1 be dropped, e.g. if your community only has one species it might make presentation of results easier. Default is TRUE

Value

An array. If the effort argument has a time dimension, or object is of class MizerSim, the output array has three dimensions (time x species x size). If the effort argument does not have a time dimension, the output array has two dimensions (species x size).

See Also

getFMortGear, project

Examples

Run this code
# NOT RUN {
data(NS_species_params_gears)
data(inter)
params <- MizerParams(NS_species_params_gears, inter)
# Get the total fishing mortality when effort is constant for all 
# gears and time:
getFMort(params, effort = 1)
# Get the total fishing mortality when effort is different
# between the four gears but constant in time:
getFMort(params, effort = c(0.5,1,1.5,0.75))
# Get the total fishing mortality when effort is different
# between the four gears and changes with time:
effort <- array(NA, dim = c(20,4))
effort[,1] <- seq(from=0, to = 1, length=20)
effort[,2] <- seq(from=1, to = 0.5, length=20)
effort[,3] <- seq(from=1, to = 2, length=20)
effort[,4] <- seq(from=2, to = 1, length=20)
getFMort(params, effort=effort)
# Get the total fishing mortality using the effort already held in a 
# MizerSim object.
sim <- project(params, t_max = 20, effort = 0.5)
getFMort(sim)
getFMort(sim, time_range = c(10,20))
# }

Run the code above in your browser using DataLab