Learn R Programming

StrathE2E2

R package containing the Strath End-to-end ecosystem model.

General Requirements

StrathE2E2 runs on the following platforms:

  • Mac OS X
  • Linux (64-bit)
  • Windows (64-bit, Windows 10 recommended)

with the following minimum runtime:

  • R 3.6 or later
  • R packages deSolve, NetIndices

Installation

There is a source package for Linux and binary packages for Windows 10 and Mac OS X in our CRAN compatible R package repository.

To install StrathE2E2, use install.packages() function and specify our repository:

install.packages("StrathE2E2", repos="https://marineresourcemodelling.gitlab.io/sran")

which will install either the source or binary package (depends on your OS).

Quick Start

To run the model:

library(StrathE2E2)
model <- e2e_read("North_Sea","1970-1999")
results <- e2e_run(model, nyears=5)
e2e_plot_ts(model,results)

Within R, type help.start() and navigate to the package documentation for various user and technical guides,

Building from source

The source package can be built on all platforms, and is the only way to install on Linux.

Download latest version from Strath E2E2 GitLab repository (use the repository download button).

In addition to the standard requirements, some additional R packages are required to build the package documentation (vignettes):

  • knitr
  • rmarkdown

For each platform there are some additional software requirements - see the individual platform build sections below.

Linux build

Full requirements for Linux build:

RequirementURL/Comment
Rhttps://cran.r-project.org/bin/windows/
R packagesdeSolve, NetIndices, knitr, rmarkdown
pandochttps://pandoc.org/
Texlivehttps://www.tug.org/texlive/

Usually Linux distributions will have everything either already installed, or available for install via the system package manager.

At a terminal prompt, try:

> R CMD INSTALL StrathE2E2-master.tar.gz

The package will be installed in your local R library folder (often ~/R).

Windows build

Full requirements for Windows build:

RequirementURL/Comment
Rhttps://cran.r-project.org/bin/windows/
R packagesdeSolve, NetIndices, knitr, rmarkdown
Rtoolshttps://cran.r-project.org/bin/windows/Rtools
pandochttps://pandoc.org/
MikTeXhttps://miktex.org/
pdfpageshttps://ctan.org/pkg/pdfpages

Install Rtools as administrator and make sure the box to Add rtools to the system PATH is checked.

Add the R bin folder to the system PATH as well. Go to Control Panel->System and Security->System then select Advanced system settings. Click on the Environment Variables button edit the PATH variable, adding the path to the R bin folder, something like:

> C:\Program Files\R\R-3.6.1\bin

If you upgrade R at a later date you must remember to update this PATH setting as well.

In a cmdtool navigate to working folder where the unpacked source code resides in a sub-folder.

Start R and run:

> library(devtools)
> document("StrathE2E2")

Then on command line:

> R CMD build StrathE2E2
> R CMD INSTALL --build StrathE2E2_3.3.0.tar.gz

This will build the binary package StrathE2E2_3.3.0.zip

MacOS X build

Full requirements for MacOS build:

RequirementURL/Comment
Rhttps://cran.r-project.org/bin/macosx
R packages:deSolve, NetIndices, knitr, rmarkdown
X11 Quartzhttps://www.xquartz.org/
pandochttps://pandoc.org/
MacTeXhttps://www.tug.org/mactex

make sure to restart any terminal applications after installing these packages.

Within a Terminal, unpack the downloaded source package and install/build:

tar zxvf StrathE2E2_3.3.0.tar.gz
R CMD INSTALL --build StrathE2E2

If the command line developer tools are missing you should accept the offer of installing them.

A successful build will install the package in R, and there will also be a binary package file StrathE2E2_3.3.0.tgz created.

Copy Link

Version

Install

install.packages('StrathE2E2')

Monthly Downloads

156

Version

3.3.0

License

GPL (>= 2)

Maintainer

Michael Heath

Last Published

January 22nd, 2021

Functions in StrathE2E2 (3.3.0)

e2e_extract_hr

Extract the values of harvest ratios generated by the fleet model.
StrathE2E2

StrathE2E2 Package
e2e_compare_runs_box

Box and whisker plots comparing annual or monthly outputs from single or Monte Carlo baseline and scenario model runs.
e2e_get_parmdoc

Get documentation on the parameters in the model.
e2e_compare_obs

Box and whisker plots comparing annual or monthly observational data with corresponding model outputs.
e2e_get_senscrit

Get documentation on the model outputs available as the basis for sensitivity analysis.
e2e_extract_start

Extract the values of all the state variables at the end of a model run and format for use as new initial conditions.
e2e_calculate_hrscale

Calculate initial values of the scaling parameters for the fishing fleet model which link effort to harvest ratios.
e2e_copy

Make a copy of a named model/variant and documentation in a user defined workspace
e2e_compare_runs_bar

Create tornado bar-plots of the differences between two model runs.
e2e_plot_catch

Plot the distribution and composition of annual catches across guild, zones and gears in the final year of a model run.
e2e_optimize_eco

Optimize StrathE2E ecology model parameters to maximise the likelihood of observed ecosystem target data.
e2e_optimize_act

Optimize StrathE2E fishing gear activity multipliers to maximumize the likelihood of either observed ecosystem target data or know harvest ratios.
e2e_plot_eco

Plot daily data on ecological outputs from the model over the final year of a run, optionally with credible intervals.
e2e_merge_sens_mc

Combine two or more sets of raw output data from parallel sensitivity or Monte Carlo analysis runs performed on separate machines/processors.
e2e_ls

List the available models in a designated workspace.
e2e_optimize_hr

Optimize StrathE2E harvest ratio multipliers to maximum the likelihood of observed ecosystem target data.
e2e_plot_biomass

Plot showing the annual annual average biomass densities of each guild in the inshore and offshore zones, optionally with credible intervals.
e2e_run

Run the StrathE2E model with a given configuration.
e2e_read

Read all the configuration, driving and parameter files for a designated model and compile the data into a list object.
e2e_plot_ycurve

Plot fishery yield curve data for planktivorous or demersal fish.
e2e_run_mc

Run a Monte Carlo simulation with StrathE2E and derive centiles of credible values of model outputs.
e2e_process_sens_mc

Post-process already-created data from sensitivity or Monte Carlo analysis runs.
e2e_plot_ts

Plot ecology model state variables or fishery catches for the full duration of a model run.
e2e_plot_edrivers

Plot climatological year of environmental driving data.
e2e_plot_fdrivers

Plot shaded-grid-cell diagrams of the distributions of fishing-related drivers across gears, guilds and seabed habitats.
e2e_plot_opt_diagnostics

Plot diagnostic data on the performance of parameter optimization functions.
e2e_plot_migration

Plot daily data on migration fluxes by actively mobile guilds during the final year of a run, optionally with credible intervals.
e2e_run_sens

Perform a parameter sensitivity analysis on the StrathE2E model.
e2e_run_ycurve

Run a set of models to generate fishery yield curve data for either planktivorous or demersal fish.
e2e_plot_sens_mc

Plot diagnostic data from sensitivity and Monte Carlo analyses.
e2e_plot_trophic

Plot showing the annual mean trophic level index, and the omnivory index of each guild during the final year of a model run, optionally with credible intervals.