Learn R Programming

mizer (version 1.0.1)

project: project method for the size based modelling

Description

Runs the size-based model simulation and projects the size based model through time. project is called using an object of type '>MizerParams and an object that contains the effort of the fishing gears through time. The method returns an object of type '>MizerSim which can then be explored with a range of summary and plotting methods.

Usage

project(object, effort, ...)

# S4 method for MizerParams,missing project(object, effort, ...)

# S4 method for MizerParams,numeric project(object, effort, t_max = 100, dt = 0.1, ...)

# S4 method for MizerParams,array project(object, effort, t_save = 1, dt = 0.1, initial_n = object@initial_n, initial_n_pp = object@initial_n_pp, shiny_progress = NULL, ...)

Arguments

object

A '>MizerParams object

effort

The effort of each fishing gear through time. See notes below.

...

Currently unused.

t_max

The maximum time the projection runs for. The default value is 100. However, this argument is not needed if an array is used for the effort argument, in which case this argument is ignored. See notes below.

dt

Time step of the solver. The default value is 0.1.

t_save

The frequency with which the output is stored. The default value is 1. Must be an integer multiple of dt.

initial_n

The initial populations of the species. By default the initial_n slot of the '>MizerParams argument is used. See the notes below.

initial_n_pp

The initial population of the background spectrum. It should be a numeric vector of the same length as the w_full slot of the MizerParams argument. By default the initial_n_pp slot of the '>MizerParams argument is used.

shiny_progress

A shiny progress object used to update shiny progress bar. Default NULL.

Value

An object of type MizerSim.

See Also

MizerParams

Examples

Run this code
# NOT RUN {
# Data set with different fishing gears
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)
# With constant fishing effort which is different for each gear
effort <- c(Industrial = 0, Pelagic = 1, Beam = 0.5, Otter = 0.5)
sim <- project(params, t_max = 20, effort = effort)
# With fishing effort that varies through time for each gear
gear_names <- c("Industrial","Pelagic","Beam","Otter")
times <- seq(from = 1, to = 10, by = 1)
effort_array <- array(NA, dim = c(length(times), length(gear_names)),
    dimnames = list(time = times, gear = gear_names))
effort_array[,"Industrial"] <- 0.5
effort_array[,"Pelagic"] <- seq(from = 1, to = 2, length = length(times))
effort_array[,"Beam"] <- seq(from = 1, to = 0, length = length(times))
effort_array[,"Otter"] <- seq(from = 1, to = 0.5, length = length(times))
sim <- project(params, effort = effort_array)
# }

Run the code above in your browser using DataLab