plot_SSB {LeMaRns}R Documentation

Plot Spawning Stock Biomass (SSB)

Description

Plots community and/or species-specific Spawning Stock Biomass (SSB) or total biomass.

Usage

plot_SSB(inputs, outputs, ...)

## S4 method for signature 'LeMans_param,LeMans_outputs'
plot_SSB(inputs, outputs, species, time_steps, species_names, SSB, ...)

## S4 method for signature 'LeMans_param,missing'
plot_SSB(inputs, N, species, time_steps, species_names, SSB, ...)

## S4 method for signature 'missing,LeMans_outputs'
plot_SSB(wgt, mature, outputs, species, time_steps, species_names, SSB, ...)

## S4 method for signature 'missing,missing'
plot_SSB(
  wgt,
  mature,
  N,
  species,
  species_names,
  time_steps,
  SSB,
  full_plot_only = TRUE,
  units = "g",
  ...
)

plot_biomass(inputs, outputs, ...)

## S4 method for signature 'LeMans_param,LeMans_outputs'
plot_biomass(inputs, outputs, species, time_steps, species_names, biomass, ...)

## S4 method for signature 'LeMans_param,missing'
plot_biomass(inputs, N, species, time_steps, biomass, species_names, ...)

## S4 method for signature 'missing,LeMans_outputs'
plot_biomass(wgt, outputs, species, time_steps, biomass, species_names, ...)

## S4 method for signature 'missing,missing'
plot_biomass(
  wgt,
  N,
  species,
  time_steps,
  species_names,
  biomass,
  full_plot_only = TRUE,
  units = "g",
  ...
)

Arguments

inputs

A LeMans_param object containing the parameter values of the current LeMans model. This option is only required if SSB is not provided.

outputs

A LeMans_outputs object containing the outputs of the model run. This option is only required if SSB is not provided.

...

Additional arguments.

species

A numeric value or vector or a character string or vector denoting the species to be used in the plot(s). The default is 1:dim(N)[2].

time_steps

A numeric vector denoting the time steps to be used to calculate and/or plot SSB. The default is 1:dim(N)[3] or 1:length(SSB).

species_names

A character vector of length 1:dim(N)[2] that denotes the names of the species in the model. This option is only required if inputs is not provided.

SSB

A numeric vector or a matrix representing the outputs of the function get_SSB(). This option is only required if inputs and outputs are not provided.

N

An array with dimensions nsc, nfish and tot_time representing the number of individuals in each length class for each time step, where nsc represents the number of length classes in the model, nfish represents the number of species in the model and tot_time represents the number of time steps that the model was run for. This option is only required if outputs and SSB are not provided.

wgt

A matrix with dimensions nsc and nfish representing the weight of each species in each length class. This option is only required if inputs and SSB are not provided.

mature

A matrix with dimensions nsc and nfish and elements in the range 0-1 representing the proportion of individuals that are mature for each species and length class, where nsc represents the number of length classes in the model and nfish represents the number of species in the model. This option is only required if outputs and SSB are not provided.

full_plot_only

A logical statement indicating whether a single plot depicting the SSB of all of the selected species should be produced (full_plot_only=TRUE) or multiple plots depicting the SSB of individual species should be produced (full_plot_only=FALSE). The default is TRUE.

units

A character string denoting the units of weight used in the model. The default is "g".

biomass

A numeric vector or a matrix representing the outputs of the function get_biomass(). This option is only required if inputs and outputs are not provided.

Value

plot_SSB returns line plots of the in SSB of the selected species through time.

plot_biomass returns line plots of the changes in biomass of the selected species through time.

See Also

get_SSB, get_biomass

Examples

# Set up and run the model
NS_params <- LeMansParam(NS_par, tau=NS_tau, eta=rep(0.25, 21), L50=NS_par$Lmat, other=1e12)
effort <- matrix(0.5, 10, dim(NS_params@Qs)[3])
model_run <- run_LeMans(NS_params, years=10, effort=effort)

# Calculate SSB
SSB <- get_SSB(NS_params, model_run)

# Plot SSB
plot_SSB(SSB=SSB)

# Calculate biomass
biomass <- get_biomass(NS_params, model_run)

# Plot biomass
plot_biomass(biomass=biomass)

[Package LeMaRns version 0.1.2 Index]