Learn R Programming

mizer (version 1.0.1)

plotYield: Plot the total yield of species through time

Description

After running a projection, the total yield of each species across all fishing gears can be plotted against time. The yield is obtained with getYield.

Usage

plotYield(sim, sim2, ...)

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

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

Arguments

sim

An object of class '>MizerSim

sim2

An optional second object of class '>MizerSim. If this is provided its yields will be shown on the same plot in bolder lines.

...

Other arguments to pass to getYield method

species

Name or vector of names of the species to be plotted. By default all species contained in sim 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 from all species in the system is plotted as well. Default is FALSE

log

Boolean whether yield should be plotted on a logarithmic axis. Defaults to true.

Value

A ggplot2 object

See Also

getYield

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)
plotYield(sim)
plotYield(sim, species = c("Cod", "Herring"), total = TRUE)

# Comparing with yield from twice the effort
sim2 <- project(params, effort=2, t_max=20, t_save = 0.2)
plotYield(sim, sim2, species = c("Cod", "Herring"), log = FALSE)
# }

Run the code above in your browser using DataLab