After running a projection, the biomass of each species can be plotted
against time. The biomass is calculated within user defined size limits
(see getBiomass()).
plotBiomass(
object,
species = NULL,
tlim = c(NA, NA),
y_ticks = 6,
ylim = c(NA, NA),
total = FALSE,
background = TRUE,
highlight = NULL,
log = NULL,
return_data = FALSE,
log_x = FALSE,
log_y = TRUE,
use_cutoff = FALSE,
...
)A ggplot2 object, unless return_data = TRUE, in which case a data
frame with the four variables 'Year', 'Biomass', 'Species', 'Legend' is
returned.
An object of class MizerSim
The species to be selected. Optional. By default all target species are selected. A vector of species names, or a numeric vector with the species indices, or a logical vector indicating for each species whether it is to be selected (TRUE) or not.
A numeric vector of length two providing lower and upper limits
for the time axis, e.g. c(1980, 2000). Use NA to apply no limit at
that end. Default is c(NA, NA).
The approximate number of ticks desired on the y axis.
A numeric vector of length two providing lower and upper limits
for the y axis. Use NA to refer to the existing minimum or maximum. Any
values below 1e-20 are always cut off.
A boolean value that determines whether the total biomass from all species is plotted as well. Default is FALSE.
A boolean value that determines whether background species are included. Ignored if the model does not contain background species. Default is TRUE.
Name or vector of names of the species to be highlighted.
Character string specifying which axes should use log10 scales,
in the same form as the base plot() argument. For example, "x",
"y", "xy" or "". If supplied, this overrides log_x and log_y.
For backward compatibility, TRUE and FALSE are interpreted as setting
only log_y.
A boolean value that determines whether the formatted data used for the plot is returned instead of the plot itself. Default is FALSE.
If TRUE, use a log10 x-axis. Default is FALSE.
If TRUE, use a log10 y-axis. Default is TRUE.
If TRUE, the biomass_cutoff column in the species
parameters is used as the minimum weight for each species.
Arguments setting the size range over which the biomass is
calculated (see getBiomass()):
min_wSmallest weight in size range. Defaults to smallest weight in the model.
max_wLargest weight in size range. Defaults to largest weight in the model.
min_lSmallest length in size range. If supplied, this takes
precedence over min_w.
max_lLargest length in size range. If supplied, this takes
precedence over max_w.
plotting_functions, getBiomass()
Other plotting functions:
addPlot(),
animate.ArrayTimeBySpeciesBySize(),
plot,
plot2(),
plotCDF(),
plotCDF2(),
plotDiet(),
plotFMort(),
plotFeedingLevel(),
plotGrowthCurves(),
plotMizerParams,
plotMizerSim,
plotPredMort(),
plotRelative(),
plotSpectra(),
plotSpectra2(),
plotSpectraRelative(),
plotYield(),
plotYieldGear(),
plotting_functions
# \donttest{
plotBiomass(NS_sim)
plotBiomass(NS_sim, species = c("Sandeel", "Herring"), total = TRUE)
plotBiomass(NS_sim, tlim = c(1980, 1990))
# Returning the data frame
fr <- plotBiomass(NS_sim, return_data = TRUE)
str(fr)
# }
Run the code above in your browser using DataLab