Learn R Programming

mizer (version 2.2.0)

getBiomassFrame: Get data frame of biomass of species through time, ready for ggplot2

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()).

Usage

getBiomassFrame(
  sim,
  species = NULL,
  start_time = as.numeric(dimnames(sim@n)[[1]][1]),
  end_time = as.numeric(dimnames(sim@n)[[1]][dim(sim@n)[1]]),
  ylim = c(NA, NA),
  total = FALSE,
  ...
)

Arguments

sim

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.

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.

ylim

A numeric vector of length two providing lower and upper limits 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.

...

Arguments passed on to get_size_range_array

min_w

Smallest weight in size range. Defaults to smallest weight in the model.

max_w

Largest weight in size range. Defaults to largest weight in the model.

min_l

Smallest length in size range. If supplied, this takes precedence over min_w.

max_l

Largest length in size range. If supplied, this takes precedence over max_w.

Value

A data frame