plotBiomass: Plot the biomass of species through time

Description Usage Arguments Value See Also Examples

Description

After running a projection, the biomass of each species can be plotted against time. The biomass is calculated within user defined size limits (min_w, max_w, min_l, max_l, see getBiomass).

Plot the biomass using a MizerSim object.

Usage

1
2
3
4
5
6
7
8
9
plotBiomass(sim, ...)

## S4 method for signature 'MizerSim'
plotBiomass(sim,
  species = sim@params@species_params$species[!is.na(sim@params@A)],
  start_time = as.numeric(dimnames(sim@n)[[1]][1]),
  end_time = as.numeric(dimnames(sim@n)[[1]][dim(sim@n)[1]]), y_ticks = 6,
  print_it = TRUE, ylim = c(NA, NA), total = FALSE, background = TRUE,
  ...)

Arguments

sim

An object of class MizerSim

...

Other arguments to pass to getBiomass method, for example min_w and max_w

species

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

start_time

The first time to be plotted. Default is the beginning of the time series.

end_time

The last time to be plotted. Default is the end of the time series.

y_ticks

The approximate number of ticks desired on the y axis

print_it

Display the plot, or just return the ggplot2 object. Default value is TRUE

ylim

A numeric vector of length two providing limits of for the y axis. Use NA to refer to the existing minimum or maximum. Any values below 1e-20 are always cut off.

total

A boolean value that determines whether the total biomass from all species is plotted as well. Default is FALSE

background

A boolean value that determines whether background species are included. Ignored if the model does not contain background species. Default is TRUE.

Value

A ggplot2 object

See Also

getBiomass

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)
plotBiomass(sim)
plotBiomass(sim, species = c("Cod", "Herring"), total = TRUE)
plotBiomass(sim, min_w = 10, max_w = 1000)
plotBiomass(sim, start_time = 10, end_time = 15)
plotBiomass(sim, y_ticks = 3)

## End(Not run)

drfinlayscott/mizer documentation built on May 18, 2018, 9:20 a.m.