Learn R Programming

mizer (version 3.2.0)

ArrayTimeBySpeciesBySize: S3 class for time x species x size arrays

Description

Some functions in mizer return three-dimensional arrays (time x species x size) holding quantities like fishing mortality, feeding level, or predation mortality through time. The ArrayTimeBySpeciesBySize class wraps these arrays to provide convenient print(), summary(), plot(), animate(), and as.data.frame() methods.

Usage

ArrayTimeBySpeciesBySize(
  x,
  value_name = NULL,
  units = NULL,
  params = NULL,
  representation = c("point", "average")
)

is.ArrayTimeBySpeciesBySize(x)

Value

An ArrayTimeBySpeciesBySize object (inherits from array).

is.ArrayTimeBySpeciesBySize() returns TRUE if x is an ArrayTimeBySpeciesBySize object, FALSE otherwise.

Arguments

x

A 3D array (time x species x size). For is.ArrayTimeBySpeciesBySize(), any object to test.

value_name

A string giving the human-readable name for the value.

units

A string giving the units (e.g. "1/year").

params

A MizerParams object. Used for species colours, linetypes, and size ranges in the plot() and animateSpectra() methods.

representation

Either "point" (the default) for a quantity sampled at the grid nodes, or "average" for a finite-volume bin average, which is then drawn at the geometric bin centre when the model uses second-order bin-averaging (second_order_w[["bin_average"]]). See ArraySpeciesBySize().

Details

An ArrayTimeBySpeciesBySize object behaves just like a regular array for arithmetic operations and subsetting. It carries these lightweight attributes:

  • value_name – a human-readable name for the value (e.g. "Fishing mortality").

  • units – the units of the value (e.g. "1/year").

  • params – the MizerParams object that the value was computed from.

See Also

Examples

Run this code
# \donttest{
fmort <- getFMort(NS_sim)
is.ArrayTimeBySpeciesBySize(fmort)
summary(fmort)
plot(fmort, time = 2007)
# }

Run the code above in your browser using DataLab