run: Run a Stock Synthesis model

View source: R/run.R

runR Documentation

Run a Stock Synthesis model

Description

The run() function checks for the executable via check_exe(). This involves first checking the specified directory dir for the specified SS3 executable name. If it is not found in the specified directory, then it checks the PATH. Linux systems may have an existing executable utility ⁠/usr/sbin/ss⁠ in the path. If exe = "ss3" and this file is found by check_exe(), it will be ignored based on the smaller file size relative to the SS3 executable. Linux users who want to use the workflow of having SS3 in their PATH should name the SS3 file something besides ss, such as ss3 or ss_linux.

Usage

run(
  dir = getwd(),
  exe = "ss3",
  extras = "",
  skipfinished = TRUE,
  show_in_console = FALSE,
  console_output_file = "console.output.txt",
  verbose = TRUE
)

Arguments

dir

Directory containing the model input files.

exe

Executable name. Can be just the name of the executable file if it is in the specified directory or in the user's PATH. Can also include the absolute path or a path relative to the specified directory. Needs to be a single character string, not a vector. On Windows, exe can optionally have the .exe extension appended; on Unix-based systems (i.e., Mac and Linux), no extension should be included.

extras

Additional ADMB command line arguments passed to the executable, such as "-nohess"

skipfinished

Skip any folders that already contain a Report.sso file. This can be helpful if the function is interrupted while running iteratively.

show_in_console

Show output in the R console? If FALSE, then the console output is saved to a file (specified by console_output_file) at the end of the model run.

console_output_file

File to store console output (if show_in_console = FALSE).

verbose

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

Details

Checks for presence of a Stock Synthesis executable and then runs the model with any additional arguments specified by extras.

Value

Returns one of five messages: "ran model", "model run failed", "unknown run status", "not a directory", or "contained Report.sso".

Author(s)

Ian G. Taylor, Kathryn L. Doering, Kelli F. Johnson

See Also

Other run functions: copy_SS_inputs(), jitter(), populate_multiple_folders(), profile(), retro(), tune_comps()

Examples

## Not run: 
dir <- system.file("extdata", "simple_small", package = "r4ss")
r4ss::run(dir = dir)

## End(Not run)


r4ss/r4ss documentation built on April 30, 2024, 4:42 a.m.