| plotYieldGear | R Documentation |
After running a projection, the total yield of each species by fishing gear can be plotted against time.
plotYieldGear(
object,
species = NULL,
gears = NULL,
total = FALSE,
log_x = FALSE,
log_y = TRUE,
log = NULL,
ylim = c(NA, NA),
tlim = c(NA, NA),
highlight = NULL,
return_data = FALSE,
...
)
object |
An object of class MizerSim |
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. |
gears |
A vector of gear names to be included in the plot. Default is all gears. |
total |
A boolean value that determines whether the total yield from all species is plotted as well. Default is FALSE. |
log_x |
If |
log_y |
If |
log |
Character string specifying which axes should use log10 scales,
in the same form as the base |
ylim |
A numeric vector of length two providing lower and upper limits
for the y axis. Use |
tlim |
A numeric vector of length two providing lower and upper limits
for the time axis, e.g. |
highlight |
Name or vector of names of the species to be highlighted. |
return_data |
A boolean value that determines whether the formatted data used for the plot is returned instead of the plot itself. Default is FALSE. |
... |
Arguments passed to |
This plot is pretty easy to do by hand. It just
gets the biomass using the getYieldGear() method and plots using
the ggplot2 package. You can then fiddle about with colours and linetypes
etc. Just look at the source code for details.
A ggplot2 object, unless return_data = TRUE, in which case a data
frame with the four variables 'Year', 'Yield', 'Species' and 'Gear' is
returned.
plotting_functions, getYieldGear()
Other plotting functions:
addPlot(),
animate(),
plot,
plot2(),
plotBiomass(),
plotCDF(),
plotCDF2(),
plotDiet(),
plotFMort(),
plotFeedingLevel(),
plotGrowthCurves(),
plotMizerParams,
plotMizerSim,
plotPredMort(),
plotRelative(),
plotSpectra(),
plotSpectra2(),
plotSpectraRelative(),
plotYield(),
plotYieldVsF(),
plotting_functions
params <- NS_params
sim <- project(params, effort=1, t_max=20, t_save = 0.2, progress_bar = FALSE)
plotYieldGear(sim)
plotYieldGear(sim, species = c("Cod", "Herring"), total = TRUE)
# Returning the data frame
fr <- plotYieldGear(sim, return_data = TRUE)
str(fr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.