plotSpectra: Plot the abundance spectra of each species and the background...

plotSpectraR Documentation

Plot the abundance spectra of each species and the background population

Description

After running a projection, the spectra of the abundance of each species and the background population can be plotted. The abundance is averaged over the specified time range (a single value for the time range can be used to plot a single time step). The abundance can be in terms of numbers or biomass, depending on the biomass argument.

Plot the abundance spectra using a therMizerSim object.

Usage

plotSpectra(object, ...)

## S4 method for signature 'therMizerSim'
plotSpectra(object,
  time_range = max(as.numeric(dimnames(object@n)$time)),
  min_w = min(object@params@w)/100, biomass = TRUE, print_it = TRUE, ...)

Arguments

object

An object of class therMizerSim.

...

Other arguments (currently unused)

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.

min_w

Minimum weight to be plotted (useful for truncating the background spectrum). Default value is a hundredth of the minimum size value of the community.

biomass

A boolean value. Should the biomass spectrum (TRUE) be plotted or the abundance in numbers (FALSE). Default is TRUE.

print_it

Display the plot, or just return the ggplot2 object

Value

A ggplot2 object

Examples

## Not run: 
data(NS_species_params_gears)
data(inter)
params <- therMizerParams(NS_species_params_gears, inter)
sim <- project_therMizer(params, effort=1, t_max=20, t_save = 2)
plotSpectra(sim)
plotSpectra(sim, min_w = 1e-6)
plotSpectra(sim, time_range = 10:20)
plotSpectra(sim, time_range = 10:20, biomass = FALSE)

## End(Not run)

pwoodworth-jefcoats/Size-Based-Modeling documentation built on Sept. 15, 2023, 8:13 a.m.