retro | R Documentation |
Do retrospective analyses by creating new directories, copying model files,
and iteratively changing the starter file to set the number of years of data
to exclude. Note that there was a bug for retrospectives in 3.30.01;
the user should update their model to a newer version of Stock Synthesis to
run retrospectives. To run retrospective models in parallel, use future::plan()
before running retro()
.
retro(
dir = getwd(),
masterdir = lifecycle::deprecated(),
oldsubdir = "",
newsubdir = "retrospectives",
subdirstart = "retro",
years = 0:-5,
overwrite = TRUE,
RemoveBlocks = FALSE,
verbose = FALSE,
exe = "ss3",
...
)
dir |
Directory where everything takes place. |
masterdir |
Deprecated. Use |
oldsubdir |
Subdirectory within |
newsubdir |
Subdirectory within |
subdirstart |
First part of the pattern of names for the directories in which the models will actually be run. |
years |
Vector of values to iteratively enter into the starter file for retrospective year. Should be zero or negative values. |
overwrite |
Overwrite any input files with matching names in the subdirectories where models will be run. |
RemoveBlocks |
Logical switch determining whether specifications of blocks is removed from top of control file. Blocks can cause problems for retrospective analyses, but the method for removing them is overly simplistic and probably won't work in most cases. Default=FALSE. |
verbose |
A logical value specifying if output should be printed to the screen. |
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, |
... |
Additional arguments passed to |
Ian G. Taylor, James T. Thorson, Kathryn L. Doering, Kiva L. Oken
SSgetoutput()
Other run functions:
copy_SS_inputs()
,
jitter()
,
populate_multiple_folders()
,
profile()
,
run()
,
tune_comps()
## Not run:
# note: don't run this in your main directory--make a copy in case something
# goes wrong
mydir <- "C:/Simple"
## retrospective analyses
retro(
dir = mydir,
years = 0:-5
)
retroModels <- SSgetoutput(
dirvec = file.path(mydir, "retrospectives", paste("retro", 0:-5, sep = ""))
)
retroSummary <- SSsummarize(retroModels)
endyrvec <- retroSummary[["endyrs"]] + 0:-5
SSplotComparisons(retroSummary,
endyrvec = endyrvec,
legendlabels = paste("Data", 0:-5, "years")
)
## run retrospectives in parallel
ncores <- parallelly::availableCores(omit = 1)
future::plan(future::multisession, workers = ncores)
retro(
dir = mydir,
years = 0:-5
)
future::plan(future::sequential)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.