Learn R Programming

mizer (version 1.0.1)

plotYieldGear: Plot the total yield of each species by gear through time

Description

After running a projection, the total yield of each species by fishing gear can be plotted against time.

Usage

plotYieldGear(sim, ...)

# S4 method for MizerSim plotYieldGear(sim, species = as.character(sim@params@species_params$species), print_it = TRUE, total = FALSE, ...)

Arguments

sim

An object of class '>MizerSim

...

Other arguments to pass to getYieldGear method

species

Name or vector of names of the species to be plotted. By default all species are plotted.

print_it

Display the plot, or just return the ggplot2 object. Defaults to TRUE

total

A boolean value that determines whether the total yield per gear over all species in the system is plotted as well. Default is FALSE

Value

A ggplot2 object

Details

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.

See Also

getYieldGear

Examples

Run this code
# NOT RUN {
data(NS_species_params_gears)
data(inter)
params <- MizerParams(NS_species_params_gears, inter)
sim <- project(params, effort=1, t_max=20, t_save = 0.2)
plotYieldGear(sim)
plotYieldGear(sim, species = c("Cod", "Herring"), total = TRUE)
# }

Run the code above in your browser using DataLab