View source: R/SS_changepars.R
SS_changepars | R Documentation |
Loops over a subset of control file to change parameter lines.
Current initial value, lower and upper bounds, and phase can be modified,
but function could be expanded to control other columns.
Depends on SS_parlines()
.
Used by SS_profile()
and the ss3sim package.
SS_changepars( dir = NULL, ctlfile = "control.ss_new", newctlfile = "control_modified.ss", linenums = NULL, strings = NULL, newvals = NULL, repeat.vals = FALSE, newlos = NULL, newhis = NULL, newprior = NULL, newprsd = NULL, newprtype = NULL, estimate = NULL, verbose = TRUE, newphs = NULL )
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 |
Strings (with optional partial matching) indicating which
parameters to be modified. This is an alternative to |
newvals |
Vector of new parameter values. Default=NULL.
The vector can contain |
repeat.vals |
If multiple parameter lines match criteria, repeat the
|
newlos |
Vector of new lower bounds. Default=NULL.
The vector can contain |
newhis |
Vector of new high bounds. Must be the same length as newhis
Default=NULL.
The vector can contain |
newprior |
Vector of new prior values.
Default=NULL.
The vector can contain |
newprsd |
Vector of new prior sd values.
Default=NULL.
The vector can contain |
newprtype |
Vector of new prior type.
Default=NULL.
The vector can contain |
estimate |
Optional vector or single value of TRUE/FALSE for which
parameters are to be estimated. Changes sign of phase to be positive or
negative. Default |
verbose |
More detailed output to command line. Default=TRUE. |
newphs |
Vector of new phases. Can be a single value, which will be
repeated for each parameter, the same length as newvals, where each
value corresponds to a single parameter, or |
Ian Taylor, Christine Stawitz, Chantel Wetzel
SS_parlines()
, SS_profile()
## Not run: SS_changepars( dir = "C:/ss/SSv3.30.03.05_May11/Simple - Copy", strings = c("steep", "sigmaR"), newvals = c(.4, .6) ) ## parameter names in control file matching input vector 'strings' (n=2): ## [1] "SR_BH_steep" "SR_sigmaR" ## These are the ctl file lines as they currently exist: ## LO HI INIT PRIOR PR_type SD PHASE env_var&link dev_link dev_minyr dev_maxyr ## 95 0.2 1 0.613717 0.7 0.05 1 4 0 0 0 0 ## 96 0.0 2 0.600000 0.8 0.80 0 -4 0 0 0 0 ## dev_PH Block Block_Fxn Label Linenum ## 95 0 0 0 SR_BH_steep 95 ## 96 0 0 0 SR_sigmaR 96 ## line numbers in control file (n=2): ## [1] 95 96 ## ## wrote new file to control_modified.ss with the following changes: ## oldvals newvals oldphase newphase oldlos newlos oldhis newhis comment ## 1 0.613717 0.4 4 -4 0.2 0.2 1 1 # SR_BH_steep ## 2 0.600000 0.6 -4 -4 0.0 0.0 2 2 # SR_sigmaR ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.