getMeanWeight: Calculate the mean weight of the community

View source: R/summary_methods.R

getMeanWeightR Documentation

Calculate the mean weight of the community

Description

Calculates the mean weight of the community through time. This is simply the total biomass of the community divided by the abundance in numbers. You can specify minimum and maximum weight or length range for the species. Lengths take precedence over weights (i.e. if both min_l and min_w are supplied, only min_l will be used). You can also specify the species to be used in the calculation.

Usage

getMeanWeight(sim, species = NULL, ...)

Arguments

sim

A MizerSim object

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.

...

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 vector containing the mean weight of the community through time

See Also

Other functions for calculating indicators: getCommunitySlope(), getMeanMaxWeight(), getProportionOfLargeFish()

Examples

mean_weight <- getMeanWeight(NS_sim)
years <- c("1967", "2010")
mean_weight[years]
getMeanWeight(NS_sim, species = c("Herring", "Sprat", "N.pout"))[years]
getMeanWeight(NS_sim, min_w = 10, max_w = 5000)[years]

sizespectrum/mizer documentation built on April 14, 2024, 3:08 a.m.