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.
ArraySpeciesBySize(
x,
value_name = NULL,
units = NULL,
params = NULL,
representation = c("point", "average")
)is.ArraySpeciesBySize(x)
An ArraySpeciesBySize object (inherits from matrix and array).
is.ArraySpeciesBySize() returns TRUE if x is an
ArraySpeciesBySize object, FALSE otherwise.
A matrix (species x size). For is.ArraySpeciesBySize(), any
object to test.
A string giving the human-readable name for the value.
A string giving the units (e.g. "g/year", "1/year").
A MizerParams object. Used for species colours, linetypes,
and size ranges in the plot() method.
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.
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").
# \donttest{
enc <- getEncounter(NS_params)
is.ArraySpeciesBySize(enc)
summary(enc)
# }
Run the code above in your browser using DataLab