
Plot the relative difference between two mizer array objects
Source:R/ArraySpeciesBySize-class.R, R/ArrayTimeBySpecies-class.R, R/ArrayTimeBySpeciesBySize-class.R
plotRelative.RdplotRelative() plots the difference between two compatible mizer array
objects relative to their average. If the values in the first object are
\(N_1\) and the values in the second are \(N_2\), it plots
$$2 (N_2 - N_1) / (N_1 + N_2).$$
Usage
plotRelative(x, y, ...)
# S3 method for class 'ArraySpeciesBySize'
plotRelative(
x,
y,
species = NULL,
all.sizes = FALSE,
log_x = TRUE,
wlim = c(NA, NA),
ylim = c(NA, NA),
total = FALSE,
background = TRUE,
...
)
# S3 method for class 'ArrayTimeBySpecies'
plotRelative(
x,
y,
species = NULL,
start_time = NULL,
end_time = NULL,
ylim = c(NA, NA),
total = FALSE,
background = TRUE,
log_x = FALSE,
...
)
# S3 method for class 'ArrayTimeBySpeciesBySize'
plotRelative(
x,
y,
species = NULL,
time = NULL,
all.sizes = FALSE,
log_x = TRUE,
wlim = c(NA, NA),
ylim = c(NA, NA),
total = FALSE,
background = TRUE,
...
)Arguments
- x, y
Two compatible mizer array objects of the same class.
- ...
Further arguments (currently unused).
- species
Character vector of species to include.
NULL(default) means all species.- all.sizes
If
FALSE(default), values outside a species' size range (w_mintow_max) are removed. Only applies toArraySpeciesBySize.- log_x
If
TRUE, use a log10 x-axis. Default isTRUEfor size spectra andFALSEfor time series.- wlim
A numeric vector of length two providing lower and upper limits for the weight (x) axis. Use
NAto refer to the existing minimum or maximum. Only applies toArraySpeciesBySize.- ylim
A numeric vector of length two providing lower and upper limits for the value (y) axis. Use
NAto refer to the existing minimum or maximum.- total
A boolean value that determines whether the total over all selected species is plotted as well. Default is
FALSE.- background
A boolean value that determines whether background species are included. Ignored if the model does not contain background species. Default is
TRUE.- start_time
The first time to be plotted. Default (
NULL) is the beginning of the time series. Only applies toArrayTimeBySpecies.- end_time
The last time to be plotted. Default (
NULL) is the end of the time series. Only applies toArrayTimeBySpecies.- time
The time to display. Default (
NULL) is the final time step. Only applies toArrayTimeBySpeciesBySize.
See also
Other plotting functions:
addPlot(),
animate.ArrayTimeBySpeciesBySize(),
plot,
plot2(),
plotBiomass(),
plotCDF(),
plotCDF2(),
plotDiet(),
plotFMort(),
plotFeedingLevel(),
plotGrowthCurves(),
plotMizerParams,
plotMizerSim,
plotPredMort(),
plotSpectra(),
plotSpectra2(),
plotSpectraRelative(),
plotYield(),
plotYieldGear(),
plotting_functions
Examples
# \donttest{
enc <- getEncounter(NS_params)
plotRelative(enc, enc, species = "Cod")
plotRelative(getBiomass(NS_sim), getBiomass(NS_sim), species = "Cod")
# }