change_retro: Alter a starter file for a retrospective analysis

Description Usage Arguments Details Value Which arguments to specifiy in case files Author(s) See Also Examples

View source: R/change_retro.r

Description

A retrospective analysis tests the effect of peeling back the number of operating model years observable to the estimation model. This function alters the SS3 starter file to run a retrospective analysis. If used with run_ss3sim the case file should be named R. A suggested (default) case letter is R.

Usage

1
2
change_retro(str_file_in = "starter.ss", str_file_out = "starter.ss",
  retro_yr = 0)

Arguments

str_file_in

A string providing the path to the input SS starter.ss file.

str_file_out

A string providing the path to the output SS starter.ss file.

retro_yr

*Which retrospective year to enter into the starter file. Should be 0 (no retrospective analysis) or a negative value.

Details

Note that the starter file is set up to run a single retrospective run. Therefore, if you would like to run retrospective analyses for, say, 0, 1, 2, 3, 4, and 5 years, you will need to use this function to adjust the starter file 6 separate times.

Value

A modified SS3 starter file.

Which arguments to specifiy in case files

All function argument descriptions that start with an asterisk (*) will be passed through the case files to run_ss3sim. If one of these arguments is not specified in a case file, then a value of NULL will be passed, which may or may not be an appropriate value. Other arguments will be ignored if specified.

Author(s)

Sean C. Anderson

See Also

Other change functions: change_data, change_em_binning, change_e, change_f_par, change_f, change_o, change_tv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Create a temporary folder for the output:
temp_path <- file.path(tempdir(), "ss3sim-retro-example")
dir.create(temp_path, showWarnings = FALSE)

# Locate the package data:
starterfile <- system.file("extdata", "models", "cod-om",
 "starter.ss", package = "ss3sim")

# No retrospective analysis:
change_retro(starterfile, paste0(temp_path, "/retro-0-starter.ss"),
retro_yr = 0)

# A retrospective analysis of 5 years:
change_retro(starterfile, paste0(temp_path, "/retro-5-starter.ss"),
retro_yr = -5)

ss3sim documentation built on Nov. 9, 2019, 1:06 a.m.