Skip to contents

Sets the rate at which energy is used for metabolism and activity. You will usually not need to call this function directly. Instead change the k, ks and p species parameters with given_species_params(params) <- and let mizer recalculate the metabolic rate for you. Call setMetabolicRate() directly only if you want to impose a different functional form for the size dependence of the metabolic rate. See vignette("guide-change-parameters") for a full explanation of when to reach for which level of the model.

Usage

setMetabolicRate(
  object,
  metab = NULL,
  p = deprecated(),
  reset = FALSE,
  ...,
  species = NULL
)

metab(params)

metab(params, species = NULL) <- value

Arguments

object

A MizerParams object

metab

Optional. An array (species x size) holding the metabolic rate for each species at size. If not supplied, a default is set as described in the section "Setting metabolic rate".

p

[Deprecated] The allometric metabolic exponent. Set the p column in the species parameters instead, with species_params(params)$p <- value. This argument never took effect on a MizerParams object because such an object always has a p column already, and the argument was only used to fill in a missing one.

reset

If set to TRUE, then the metabolic rate will be reset to the value calculated from the species parameters, even if it was previously overwritten with a custom value. If set to FALSE (default) then a recalculation takes place for species without a custom value.

...

Unused

species

Optional character vector of species to override or reset. Omit to override or reset the whole array. Values may be full arrays or arrays containing only the selected species. For a single species its values without the species dimension are also accepted: a vector, or a gear x size matrix for the selectivity. Other species keep their existing override status. See rate_overrides() to inspect overrides.

params

A MizerParams object

value

metab

Value

setMetabolicRate(): A MizerParams object with updated metabolic rate.

metab(): An ArraySpeciesBySize object (species x size) with the metabolic rate.

Setting metabolic rate

The metabolic rate is subtracted from the energy income rate to calculate the rate at which energy is available for growth and reproduction, see getEReproAndGrowth(). It is measured in grams/year.

If the metab argument is not supplied, then for each species the metabolic rate \(k(w)\) for an individual of size \(w\) is set to $$k(w) = k_s w^p + k w,$$ where \(k_s w^p\) represents the rate of standard metabolism and \(k w\) is the rate at which energy is expended on activity and movement. The values of \(k_s\), \(p\) and \(k\) are taken from the ks, p and k columns in the species parameter dataframe. If any of these parameters are not supplied, the defaults are \(k = 0\), \(p = n\) and $$k_s = f_c h \alpha w_{mat}^{n-p},$$ where \(f_c\) is the critical feeding level taken from the fc column in the species parameter data frame. If the critical feeding level is not specified, a default of \(f_c = 0.2\) is used.

With reset = FALSE, manually overridden species are preserved while the other species are recalculated. A message is issued if recalculation would change protected values. See rate_overrides() to inspect overrides.

Examples

# Inspect the current metabolic rate
metab(NS_params)["Cod", 1:5]
#>      0.001    0.00119    0.00142     0.0017    0.00203 
#> 0.09767498 0.11054111 0.12510202 0.14158096 0.16023056 

# Reset metabolic rate from species parameters
params <- setMetabolicRate(NS_params, reset = TRUE)
metab(params)["Cod", 1:5]
#>      0.001    0.00119    0.00142     0.0017    0.00203 
#> 0.09767498 0.11054111 0.12510202 0.14158096 0.16023056