Set species interaction matrix

setInteraction(params, interaction = NULL)

Arguments

params

MizerParams object

interaction

Interaction matrix of the species (predator by prey). Entries should be numbers between 0 and 1. See "Setting interactions" section below.

Value

MizerParams object

Setting interactions

The species interaction matrix \(\theta_{ij}\), is used when calculating the food encounter rate in getEncounter and the predation mortality rate in getPredMort. Its entries are dimensionless numbers between 0 and 1 that characterise the strength at which predator species \(i\) predates on prey species \(j\).

This function checks that the supplied interaction matrix is valid and then stores it in the interaction slot of the params object before returning that object.

The order of the columns and rows of the interaction argument should be the same as the order in the species params dataframe in the params object. If you supply a named array then the function will check the order and warn if it is different.

The interaction of the species with the plankton are set via a column interaction_p in the species_params data frame. Again the entries have to be numbers between 0 and 1. By default this column is set to all 1s.

See also

Other functions for setting parameters: setBMort(), setFishing(), setInitial(), setIntakeMax(), setMetab(), setParams(), setPlankton(), setPredKernel(), setReproduction(), setSearchVolume()

Examples

if (FALSE) { params <- newTraitParams() interaction <- params@interaction interaction[1, 3] <- 0 params <- setInteraction(params, interaction) }