Learn R Programming

⚠️There's a newer version (2.5.3) of this package.Take me there.

mizer

Mizer is an R package to run multi-species size-spectrum models of fish communities. The package has been developed to model marine ecosystems that are subject to fishing. However, it may also be appropriate for other ecosystems.

The package contains routines and functions to allow users to set up an ecosystem model, and then project it through time under different fishing strategies. Methods are included to explore the results, including plots and calculation of community indicators such as the slope of the size spectrum. Size-based models can be complicated so mizer contains many default options that can be easily changed by the user.

Mizer has been supporting research in marine ecology and fisheries science since 2014 (see publications. It is still under active development. The new version 2.0 has increased the user-friendliness and the flexibility of the framework. Contributions from the user community are very welcome. There is a sister package called mizerExperimental where user contributions can be checked out and receive feedback from the community. Example mizer models can be contributed to mizerExamples.

Does your project or publication use mizer? If so, we would love to know. You can also join our Google Discussion group here: https://groups.google.com/forum/#!forum/size-spectrum-models

Recent work on mizer was funded by the European Commission Horizon 2020 Research and Innovation Programme under Grant Agreement No 634495 for the project MINOUW (http://minouw-project.eu/) and the Australian Research Council Discovery Project Rewiring Marine Food Webs.

Installation

The package is on CRAN and therefore available from R’s built-in package manager.

# Install release version from CRAN
install.packages("mizer")

# Alternatively, install development version from GitHub
devtools::install_github("sizespectrum/mizer")

Example

The following code loads the mizer package, loads some information about species in the North Sea that comes as an example with the package, sets up the parameters for the mizer model, and runs a simulation for 10 years.

library(mizer)
params <- newMultispeciesParams(NS_species_params, inter)
sim <- project(params, t_max = 10, effort = 0)

The results of the simulation can then be analysed, for example via plots:

plot(sim)

See the accompanying Get started page for more details on how the package works, including detailed examples.

Copy Link

Version

Install

install.packages('mizer')

Monthly Downloads

397

Version

2.0.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Gustav Delius

Last Published

May 5th, 2020

Functions in mizer (2.0.1)

NS_params

Example MizerParams object for the North Sea example
double_sigmoid_length

Length based double-sigmoid selectivity function
MizerParams

Alias for set_multispecies_model
MizerSim

Constructor for the MizerSim class
N

Time series of size spectra
finalNOther

Values of other ecosystem components at end of simulation
finalN

Size spectra at end of simulation
getBiomass

Calculate the total biomass of each species within a size range at each time step.
default_pred_kernel_params

Set defaults for predation kernel parameters
BevertonHoltRDD

Beverton Holt function to calculate density-dependent reproduction rate
getCriticalFeedingLevel

Get critical feeding level
MizerParams-class

A class to hold the parameters for a size based model.
getMeanWeight

Calculate the mean weight of the community
RickerRDD

Ricker function to calculate density-dependent reproduction rate
getDiet

Get diet of predator at size, resolved by prey species
SheperdRDD

Sheperd function to calculate density-dependent reproduction rate
getEReproAndGrowth

Get energy rate available for reproduction and growth
MizerSim-class

A class to hold the results of a simulation
getM2Background

Alias for getResourceMort
getMeanMaxWeight

Calculate the mean maximum weight of the community
getPredRate

Get predation rate
getProportionOfLargeFish

Calculate the proportion of large fish
getBiomassFrame

Get data frame of biomass of species through time, ready for ggplot2
getZ

Alias for getMort
NS_species_params

Example species parameter set based on the North Sea
get_gamma_default

Get default value for gamma
NS_species_params_gears

Example species parameter set based on the North Sea with different gears
box_pred_kernel

Box predation kernel
get_time_elements

Get_time_elements
mizerEncounter

Get encounter rate needed to project standard mizer model
idxFinalT

Time index at end of simulation
getMort

Get total mortality rate
mizerPredRate

Get predation rate needed to project standard mizer model
mizerFMort

Get the total fishing mortality rate from all fishing gears by time, species and size needed to project standard mizer model
mizerRDI

Get density-independent rate of reproduction needed to project standard mizer model
getEGrowth

Get energy rate available for growth
constantRDD

Give constant reproduction rate
effort

Fishing effort used in simulation
getERepro

Get energy rate available for reproduction
getESpawning

Alias for getERepro
getFeedingLevel

Get feeding level
getFMortGear

Get the fishing mortality by time, gear, species and size
getResourceMort

Get predation mortality rate for resource
emptyParams

Create empty MizerParams object of the right size
getGrowthCurves

Get growth curves giving weight as a function of age
plotPredMort

Plot predation mortality rate of each species against size
getM2

Alias for getPredMort
getYield

Calculate the total yield of each species
getSSB

Calculate the SSB of species
getCommunitySlope

Calculate the slope of the community abundance
setComponent

Add a dynamical ecosystem component
getYieldGear

Calculate the total yield per gear and species
plotSpectra

Plot the abundance spectra
getComponent

Get information about other ecosystem components
getEncounter

Get encounter rate
getFMort

Get the total fishing mortality rate from all fishing gears by time, species and size.
inter

Example interaction matrix for the North Sea example
setExtMort

Set external mortality rate
getRDD

Get density dependent reproduction rate
knife_edge

Weight based knife-edge selectivity function
setMaxIntakeRate

Set maximum intake rate
setMetabolicRate

Set metabolic rate
setResource

Set up resource
getPredKernel

Get predation kernel
getPredMort

Get total predation mortality rate
mizer

mizer: Multi-species size-based modelling in R
getRDI

Get density independent rate of egg production
getN

Calculate the number of individuals within a size range
setRmax

Set maximum reproduction rate
mizerEGrowth

Get energy rate available for growth needed to project standard mizer model
getPhiPrey

Get available energy
plotBiomass

Plot the biomass of species through time
get_ks_default

Get default value for ks
params

Extract the parameter object underlying a simulation
times

Times for which simulation results are available
initialNResource<-

Initial value for resource spectrum
get_phi

Get values from feeding kernel function
mizerPredMort

Get total predation mortality rate needed to project standard mizer model
newCommunityParams

Set up parameters for a community-type model
initialNOther<-

Initial values for other ecosystem components
mizerMort

Get total mortality rate needed to project standard mizer model
plotM2

Alias for plotPredMort
newMultispeciesParams

Set up parameters for a general multispecies model
get_h_default

Get default value for h
plotFeedingLevel

Plot the feeding level of species by size
truncated_lognormal_pred_kernel

Truncated lognormal predation kernel
resource_constant

Keep resource abundance constant
plot,MizerSim,missing-method

Summary plot for MizerSim objects
resource_semichemostat

Project resource using semichemostat model
setPredKernel

Set predation kernel
set_multispecies_model

Deprecated obsolete function for setting up multispecies parameters
species_params

Species parameters
get_size_range_array

Get size range array
get_required_reproduction

Determine reproduction rate needed for initial egg abundance
indicator_functions

Description of indicator functions
initialN<-

Initial values for fish spectra
set_species_param_default

Set a species parameter to a default value
mizerFMortGear

Get the fishing mortality by time, gear, species and size needed to project standard mizer model
lognormal_pred_kernel

Lognormal predation kernel
summary,MizerParams-method

Summarize MizerParams object
get_initial_n

Calculate initial population abundances for the community populations
log_breaks

Helper function to produce nice breaks on logarithmic axes
summary,MizerSim-method

Summarize MizerSim object
plotGrowthCurves

Plot growth curves giving weight as a function of age
retune_erepro

Retune reproduction efficiency to maintain initial egg abundances
mizerERepro

Get energy rate available for reproduction needed to project standard mizer model
mizerRates

Get all rates needed to project standard mizer model
project

Project size spectrum forward in time
plotFMort

Plot total fishing mortality of each species by size
plotDiet

Plot diet
mizerEReproAndGrowth

Get energy rate available for reproduction and growth needed to project standard mizer model
mizerResourceMort

Get predation mortality rate for resource needed to project standard mizer model
reexports

Objects exported from other packages
setColours

Set line colours to be used in mizer plots
mizerFeedingLevel

Get feeding level needed to project standard mizer model
setRateFunction

Set own rate function to replace mizer rate function
noRDD

Give density-independent reproduction rate
plotYieldGear

Plot the total yield of each species by gear through time
plotYield

Plot the total yield of species through time
newTraitParams

Set up parameters for a trait-based model
plotting_functions

Description of the plotting functions
setFishing

Set fishing parameters
steady

Set initial values to a steady state for the model
sigmoid_weight

Weight based sigmoidal selectivity function
setInitialValues

Set initial values to final values of a simulation
power_law_pred_kernel

Power-law predation kernel
set_community_model

Deprecated function for setting up parameters for a community-type model
setSearchVolume

Set search volume
setReproduction

Set reproduction parameters
summary_functions

Description of summary functions
setInteraction

Set species interaction matrix
sigmoid_length

Length based sigmoid selectivity function
setLinetypes

Set linetypes to be used in mizer plots
test_dyn

Dummy function used during testing only
validGearParams

Check validity of gear parameters and set defaults for missing but required parameters or transfer them from species_params if available
set_trait_model

Deprecated function for setting up parameters for a trait-based model
upgradeParams

Upgrade MizerParams object from earlier mizer versions
validSpeciesParams

Check validity of species parameters and set defaults for missing but required parameters
w

Size bins
upgradeSim

Upgrade MizerSim object from earlier mizer versions
validate_effort_vector

Check that an effort vector is specified correctly
NOther

Time series of other components