Learn R Programming

r4ss (version 1.11)

SS_changepars: Change parameters in the control file.

Description

A function to take advantage of SS_parlines that could be used to create a series of control files with different parameter values. This is used by SS_profile, but may also be useful for simulation work.

Usage

SS_changepars(dir = "C:/myfiles/mymodels/myrun/",
ctlfile = "control.ss_new", newctlfile = "control_modified.ss",
linenums = NULL, strings = NULL, newvals = NULL, estimate = FALSE,
verbose = TRUE)

Arguments

dir
Directory with control file to change.
ctlfile
Control file name. Default="control.ss_new".
newctlfile
Name of new control file to be written. Default="control_modified.ss".
linenums
Line numbers of control file to be modified. Either this or the Strings input are needed. Default=NULL.
strings
Strings (with optional partial matching) indicating which parameters to be modified. This is an alternative to linenums. Strings correspond to the commented parameter names included in control.ss_new, or whatever is written as comment at the e
newvals
Vector of new parameter values. Default=NULL.
estimate
Vector of TRUE/FALSE for which changed parameters are to be estimated. Default=FALSE.
verbose
More detailed output to command line. Default=TRUE.

See Also

SS_parlines, SS_profile

Examples

Run this code
SS_changepars(dir='Y:/ss/SSv3.03a/Simple/',ctlfile='Control.SS_New',
              strings=c('SR_steep','SR_sigmaR'),newvals=c(.35,.6))
# [1] wrote new file to Control_Modified.SS
#    oldvals newvals oldphase newphase     comment
# 1 0.609048    0.35        4       -4  # SR_steep
# 2 0.600000    0.60       -4       -4 # SR_sigmaR

Run the code above in your browser using DataLab