Learn R Programming

mizer (version 1.0.1)

getMeanMaxWeight: Calculate the mean maximum weight of the community

Description

Calculates the mean maximum weight of the community through time. This can be calculated by numbers or biomass. The calculation is the sum of the w_inf * abundance of each species, divided by the total abundance community, where abundance is either in biomass or 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

getMeanMaxWeight(object, ...)

# S4 method for MizerSim getMeanMaxWeight(object, species = 1:nrow(object@params@species_params), measure = "both", ...)

Arguments

object

An object of class MizerSim.

...

Other arguments for the getN and getBiomass methods such as min_w, max_w min_l and max_l.

species

numeric or character vector of species to include in the calculation.

measure

The measure to return. Can be 'numbers', 'biomass' or 'both'

Value

A matrix or vector containing the mean maximum weight of the community through time

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=10)
getMeanMaxWeight(sim)
getMeanMaxWeight(sim, species=c("Herring","Sprat","N.pout"))
getMeanMaxWeight(sim, min_w = 10, max_w = 5000)
# }

Run the code above in your browser using DataLab