View source: R/indicator_functions.R
| getMeanWeight | R Documentation |
getMeanWeight() calculates the mean weight of the community. This is simply
the total biomass of the community divided by the abundance in numbers.
getMeanLength() calculates the mean length of the community, i.e. the total
length of all individuals divided by their number, where the length of an
individual of weight w of species i is obtained from the
length-weight relationship w = a_i l^{b_i} with the species parameters
a and b.
getMeanWeight(object, species = NULL, ...)
getMeanLength(object, species = NULL, ...)
object |
A MizerSim or MizerParams 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
|
The length-weight parameters a and b are taken from the species parameter
data frame, where they are given the defaults a = 0.01 and b = 3 when a
model is created. getMeanLength() gives an error if a model is so old that
it has no such columns.
You can specify minimum and maximum weight or length for the included size range. 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.
You will usually want to give a minimum size. Over the full size range the
community is dominated in numbers by the smallest individuals, so both means
describe the larvae rather than the fish, and in the case of
getMeanLength() they do so with a length-weight relationship that was
fitted to observed fish and is being extrapolated far below the sizes it
describes. A minimum size also makes the indicator comparable to one
calculated from survey data, which sees only the sizes the gear catches.
A vector containing the mean weight (in grams) or the mean length (in
cm) of the community through time, or a single value if called with a
MizerParams object.
Other functions for calculating indicators:
getCommunitySlope(),
getMeanMaxWeight(),
getProportionOfLargeFish()
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]
getMeanWeight(NS_params)
mean_length <- getMeanLength(NS_sim)
mean_length[years]
# Only a couple of centimetres, because the larvae outnumber everything
# else. Give a minimum size to get an indicator about fish:
getMeanLength(NS_sim, min_l = 10)[years]
getMeanLength(NS_sim, min_w = 10, max_w = 5000)[years]
getMeanLength(NS_sim, species = c("Herring", "Sprat", "N.pout"),
min_l = 10)[years]
getMeanLength(NS_sim@params, min_l = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.