Learn R Programming

mizer (version 3.2.0)

ArraySpeciesBySize: S3 class for species x size rate arrays

Description

Many functions in mizer return two-dimensional arrays (species x size) holding rates like encounter rate, feeding level, growth rate, mortality etc. The ArraySpeciesBySize class wraps these arrays to provide convenient print(), summary(), plot(), and as.data.frame() methods.

Usage

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

is.ArraySpeciesBySize(x)

Value

An ArraySpeciesBySize object (inherits from matrix and array).

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

Arguments

x

A matrix (species x size). For is.ArraySpeciesBySize(), any object to test.

value_name

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

units

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

params

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

representation

Either "point" (the default) for a quantity sampled at the grid nodes, or "average" for a finite-volume bin average. A bin-averaged quantity is drawn at the geometric bin centre rather than the left bin edge, but only when the model uses second-order bin-averaging (second_order_w[["bin_average"]]), so default plots are unchanged.

Details

An ArraySpeciesBySize object behaves just like a regular matrix for arithmetic operations and subsetting. It carries two lightweight attributes:

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

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

See Also

Examples

Run this code
# \donttest{
enc <- getEncounter(NS_params)
is.ArraySpeciesBySize(enc)
summary(enc)
# }

Run the code above in your browser using DataLab