
Plot the relative difference in between the total biomasses of each each species within a size range at steady state
Source:R/reef-analysis_plots.R
plotTotalBiomassRelative.RdThis functions creates a barplot with the relative change in biomass of each species within a size range between either (1) two different mizerParams objects (two models) or (2) two different size ranges.
Usage
plotTotalBiomassRelative(
object1,
object2,
diff_method,
species = NULL,
min_fishing_l1 = NULL,
max_fishing_l1 = NULL,
min_fishing_l2 = NULL,
max_fishing_l2 = NULL,
return_data = FALSE,
...
)
plotlyTotalBiomassRelative(object1, object2, diff_method, ...)Arguments
- object1
First MizerParams or MizerSim object.
- object2
Second MizerParams or MizerSim object.
- diff_method
The method to calculate the relative change between models. If
percent_change, the percent change is calculated relative to the value from object 1 with formula 100*(new-old)/old. Ifrel_diffthe relative difference is returned given by (new - old)/(old + new).- species
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.
- min_fishing_l1
Optional. The minimum length (cm) of fished individuals for model 2. Defaults to 7cm. A parameter passed to
getProductivity().- max_fishing_l1
Optional. The maximum length (cm) of fished individuals for model 1. Defaults to max length. A parameter passed to
getProductivity().- min_fishing_l2
Optional. The minimum length (cm) of fished individuals for model 2. Defaults to 7cm. A parameter passed to
getProductivity().- max_fishing_l2
Optional. The maximum length (cm) of fished individuals for model 1. Defaults to max length. A parameter passed to
getProductivity().- return_data
A boolean value that determines whether the formatted data used for the plot is returned instead of the plot itself. Default value is FALSE.
- ...
Arguments passed on to
plotTotalBiomassobjectAn object of class MizerParams or MizerSim. If a MizerSim object is provided, the biomass at the last time step is used.
min_fishing_lThe minimum length (cm) for biomass estimates. Defaults to smallest size.
max_fishing_lThe maximum length (cm) of for biomass estimates. Defaults to max length.
Value
A ggplot2 object, unless return_data = TRUE, in which case a data
frame with the the total steady state biomass for each functional
group by model is returned as well as another column called
rel_diffthat gives the relative difference between the two
values.
Details
This function is usually used in conjunction with
plotProductivityRelative() to check for decoupling between biomass and
productivity.
The individual productivity rates are calculated by the
plotTotalBiomass() function which is passed all additional arguments you
supply. See plotTotalBiomass() for more details.
To compare between different size ranges, use the min_fishing_l1
and max_fishing_l1 arguments for the first size range and the
min_fishing_l2and max_fishing_l2 arguments for the second.
See also
plotBiomass(), plot2TotalBiomass(), plotTotalBiomassRelative(),
plotProductivity(), plot2Productivity(), plotProductivityRelative()
Other plotting functions:
plot2Productivity(),
plot2TotalBiomass(),
plotDegScale(),
plotDegradationScale(),
plotProductivity(),
plotProductivityRelative(),
plotRefugeDensity(),
plotRefugeProfile(),
plotRelativeContribution(),
plotSpectraChange(),
plotTotalAbundance(),
plotTotalBiomass(),
plotVulnerable()