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.

Usage

reduceEcopathDiet(species_params, ecopath_diet)

Arguments

species_params

A data frame with mizer species parameters

ecopath_diet

The Ecopath diet matrix, as exported by the Ecopath software.

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, an extra column "other" for groups not included in the model. The matrix entries give for each predator the proportion of its diet that comes from each prey species or from other ecosystem components.

Examples

# Generate a reduced diet matrix
diet_matrix <- reduceEcopathDiet(
    species_params = species_params_example,
    ecopath_diet = ecopath_diet_example
)

# View first few rows of the result
head(diet_matrix)
#>                 prey
#> predator                Hake       Megrim Horse mackerel     other
#>   Hake           0.011343712 0.0193336309     0.10184681 0.8674759
#>   Megrim         0.002535134 0.0002813999     0.07453295 0.9226505
#>   Horse mackerel 0.000000000 0.0000000000     0.00000000 1.0000000