Skip to contents
library(spmR)
here::here()
#> [1] "/Users/jim/_mymods/afsc-assessments/spmR"

Working examples of the spmR package

This vignette provides examples of how to use the spmR package to run the Standard Projection Model (SPM) for Alaska groundfish. The SPM is a stock assessment model used to project the future status of fish stocks. The spmR package provides an R interface to the SPM model, allowing users to run the model and analyze the results in R. There are three main functions in the spmR package: runSPM, plotSPM, and dat2list (and list2dat). The runSPM function runs the SPM model and returns the results as a data frame. The plotSPM function creates plots of the SPM results. The list2dat and dat2list functions convert between local R lists and datafiles used by SPM externally. A draft function called print_Tier3_tables is set up to provide some capabilities to create tables for markdown documents. This vignette demonstrates how to use these functions to run the SPM model and analyze the results.

Example sets

The following case studies have been applied.

Atka mackerel

df <- runSPM(here::here("examples","atka"),run=FALSE)
setwd("spmR")
plotSPM(df)

BSAI northern rock sole

df <- runSPM(here::here("examples","BSAI NRS"),run=FALSE)
plotSPM(df)

EBS pollock

df <- runSPM(here::here("examples","ebspollock"),run=FALSE)
plotSPM(df)

BSAI yellowfin sole

df <- runSPM(here::here("examples","yfs"),run=FALSE)
 plotSPM(df)

GOA Rougheye blackspotted