Skip to contents

mizer's getDiet(), getTrophicLevel() and getTrophicLevelBySpecies() include the predation refuge on mizerReef models through getEncounterByPrey.mizerReef(). These methods only check the time argument and then call mizer's methods.

Usage

# S3 method for class 'mizerReef'
getDiet(object, proportion = TRUE, ...)

# S3 method for class 'mizerReef'
getTrophicLevel(
  params,
  n = initialN(params),
  n_pp = initialNResource(params),
  n_other = initialNOther(params),
  w_R = 1e-10,
  beta_R = 1000,
  t = 0,
  ...
)

# S3 method for class 'mizerReef'
getTrophicLevelBySpecies(
  params,
  n = initialN(params),
  n_pp = initialNResource(params),
  n_other = initialNOther(params),
  w_R = 1e-10,
  beta_R = 1000,
  t = 0,
  ...
)

Arguments

object, params

A mizerReef params object.

proportion, n, n_pp, n_other, w_R, beta_R, t, ...

Passed on to mizer's method. See mizer::getDiet(), mizer::getTrophicLevel() and mizer::getTrophicLevelBySpecies().

Value

As returned by mizer's method.

Details

The trophic level is not yet right on reef models, in two ways. mizer gives algae and detritus trophic level 0, so herbivores and large invertebrates come out near 1 instead of 2. And for predators blocked by refuge, it averages each prey species' trophic level over all its sizes, including those hidden in refuge.

For a params object, give the time as t, a single year. It matters when refuge degradation is switched on (see setDegradation()). mizer's methods would take a time_range argument into ... and silently return the result at t = 0, so these methods stop instead. time_range selects the saved times of a simulation: use it with getDiet(sim).

Examples

params <- setDegradation(caribbean_3_model, deg_scale = rubble_scale,
                         bleach_time = 1, degrade = TRUE)
# The diet after bleaching
diet <- getDiet(params, t = 3)
# Not like this: time_range is for simulations
try(getDiet(params, time_range = 3))
#> Error : For a params object, getDiet() takes a single time as `t`. `time_range` selects the saved times of a simulation, as in `getDiet(sim, time_range = 3)`.