plotM2: Plot predation mortality rate of each species against size

Description Usage Arguments Value See Also Examples

Description

After running a projection, plot the predation mortality rate of each species by size. The mortality rate is averaged over the specified time range (a single value for the time range can be used to plot a single time step).

Plot M2 using a MizerSim object.

Usage

1
2
3
4
5
6
plotM2(sim, ...)

## S4 method for signature 'MizerSim'
plotM2(sim,
  species = as.character(sim@params@species_params$species),
  time_range = max(as.numeric(dimnames(sim@n)$time)), print_it = TRUE, ...)

Arguments

sim

An object of class MizerSim

...

Other arguments to pass to getM2 method.

species

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

time_range

The time range (either a vector of values, a vector of min and max time, or a single value) to average the abundances over. Default is the final time step.

print_it

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

Value

A ggplot2 object

See Also

getM2

Examples

1
2
3
4
5
6
7
8
9
## 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 = 2)
plotM2(sim)
plotM2(sim, time_range = 10:20)

## End(Not run)

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