Learn R Programming

r4ss (version 1.44.0)

SS_read: 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)

See Also

Examples

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

Run the code above in your browser using DataLab