Learn R Programming

mizer (version 0.4)

plotM2: Plot M2 of each species by size

Description

After running a projection, plot M2 of each species by size. M2 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

plotM2(object, ...)

# S4 method for MizerSim plotM2(object, time_range = max(as.numeric(dimnames(object@n)$time)), print_it = TRUE, ...)

Arguments

object

An object of class MizerSim

...

Other arguments to pass to getM2 method.

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

Value

A ggplot2 object

See Also

getM2

getM2

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 = 2)
plotM2(sim)
plotM2(sim, time_range = 10:20)
# }

Run the code above in your browser using DataLab