SS_read: Read all Stock Synthesis input files for a model

View source: R/SS_read.R

SS_readR Documentation

Read all Stock Synthesis input files for a model

Description

Read all the input files for a Stock Synthesis model into R as a list object. These files will be in a single directory on your machine, i.e., dir. Functionality comes from the r4ss::SS_read*() functions. This function simplifies the number of lines of code you need to write by using all of the read functions to read in the starter, control, data, and forecast files. The starter file is helpful because it provides names for the control and data files.

Usage

SS_read(dir = NULL, ss_new = FALSE, verbose = FALSE)

Arguments

dir

A file path to the directory of interest. Typically used with file, an additional input argument, to specify input and output file paths. The default value is dir = NULL, which leads to using the current working directory, and thus, full file paths should not be specified for other arguments as they will be appended to dir.

ss_new

A logical that controls if the .ss_new files or the original input files are read in. The default is to read the original files.

verbose

A logical value specifying if output should be printed to the screen.

Value

An invisible list is returned. The first element is the directory that was provided in the argument dir. The second element is the result of normalizePath(dir), which gives the full path. The remaining four elements are list objects from reading in the following input files:

  • data

  • control

  • starter

  • forecast

  • wtatage (will be NULL if not required by the model)

Author(s)

Ian G. Taylor, Kelli F. Johnson

See Also

  • SS_write() can be used to write the input files using the list created by this function.

  • SS_readstarter(), SS_readdat(), SS_readctl(), SS_readforecast(), and SS_readwtatage() are used by this function to read in the input files.

  • SS_output() to read in equivalent SS3 output files.

Examples

# Read in the 'simple' example model stored in {r4ss}
inputs <- SS_read(
  dir = system.file("extdata", "simple_3.30.13", package = "r4ss")
)

r4ss documentation built on May 28, 2022, 1:11 a.m.