Skip to contents

Aggregates a group-level Ecopath diet matrix to the species level defined in a mizer model, using a mapping dictionary from Ecopath groups (e.g., juvenile/adult stanzas) to a single mizer species. Produces a species-by-species diet matrix, including an "other" category to account for diet contributions from Ecopath groups not included in the model. The contributions of each stanza are first summed, each scaled by its consumption rate (Q = B * Q/B), and the result is then normalised to proportions.

Usage

reduceEcopathDiet(species_params, ecopath_diet, ecopath_params)

Arguments

species_params

A data frame with mizer species parameters.

ecopath_diet

The Ecopath diet matrix, as exported by the Ecopath software. Rows correspond to prey groups, columns to predator groups.

ecopath_params

The basic parameters data frame, containing at least biomass and consumption/biomass for each group.

Value

A matrix with dimnames predator and prey, where the row names are the species names of the predators and the column names are the species names of the prey, plus an extra column "other" for groups not included in the model. The matrix entries give, for each predator, the proportion of its total consumption that comes from each prey species or from other ecosystem components.

Details

This produces a species-by-species diet matrix, including an "other" category to account for diet contributions from Ecopath groups not included in the model.

This function assumes that the supplied Ecopath diet matrix contains proportions (not absolute rates).

Examples

if (FALSE) { # \dontrun{
# Generate a reduced diet matrix
diet_matrix <- reduceEcopathDiet(
    species_params = species_params_example,
    ecopath_diet = ecopath_diet_example,
    ecopath_params = ecopath_params_example
)

# View first few rows of the result
head(diet_matrix)
} # }