change_pars | R Documentation |
applies no LO, HI, INIT, or PHASE value to parameter line in a table of
parameters within the list created by get_inputs_ling()
or
r4ss::SS_readctl()
. This is similar to r4ss::SS_changepars()
but that function modifies the control file itself not the corresponding
R object.
change_pars(
pars,
string,
LO = NULL,
HI = NULL,
INIT = NULL,
PHASE = NULL,
PRIOR = NULL,
PR_SD = NULL,
PR_type = NULL,
Block = NULL,
Block_Fxn = NULL,
allrows = TRUE,
verbose = TRUE
)
pars |
A parameter table from the control file list object. For the
initial 2021 lingcod models, this can be any of
|
string |
String which matches part of the parameter labels for the parameters to be modified. When multiple parameters match the string they will all be changed. |
LO |
New lower bound value |
HI |
New upper bound value |
INIT |
New initial value |
PHASE |
New phase value |
Block |
New block value (which block pattern to use) |
Block_Fxn |
New phase function value (e.g. 2 = replace) |
allrows |
Logical: TRUE = return the full parameter table,
FALSE = return only the parameter lines that match |
verbose |
A logical value specifying if output should be printed
to the console or not. The default is |
Either the full table of parameters that can be inserted into
directly into the inputs$ctl list or (if allrows = FALSE
),
a subset of that table with just the lines matching string
.
Ian G. Taylor
## Not run:
# read inputs
inputs <- get_inputs_ling(id = get_id_ling(newdir))
# copy control file info to new object
newctl <- inputs$ctl
# update parameter lines for first double-normal parameter
newctl$size_selex_parms <-
change_pars(pars = newctl$size_selex_parms,
string = "SizeSel_P_1",
LO = 20,
HI = 100,
INIT = 60
PHASE = 3)
# check which lines match a string with no changes
change_pars(pars = newctl$SR_parm, string = "R0", allrows = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.