Edit parameter values, fix/unfix them, or edit lower/upper bounds.

NMwriteInits(
  file.mod,
  update = TRUE,
  file.ext = NULL,
  ext,
  values,
  newfile,
  ...
)

Arguments

file.mod

Path to control stream.

update

If `TRUE` (default), the parameter values are updated based on the `.ext` file.

file.ext

Optionally provide the path to an `.ext` file. If not provided, the default is to replace the file name extention on `file.mod` with `.ext`. This is only used if `update=TRUE`.

ext

Not implemented.

values

A list of lists. Each list specifies a parameter with named elements. Must be named by the parameter name. `lower`, `upper` and `fix` can be supplied to modify the parameter. See examples. Notice, you can use `...` instead. `values` may be easier for programming but other than that, most users will find `...` more intuitive.

newfile

If provided, the results are written to this file as a new input control stream.

...

Parameter specifications. See examples,

Value

a control stream as lines in a character vector.

Details

Limitations:

  • lower, init, and upper must be on same line

  • If using something like CL=(.1,4,15), two of those cannot be on the same line

Examples

## Requires NMdata 0.1.9
if (FALSE) { # \dontrun{
file.mod <- system.file("examples/nonmem/xgxr021.mod",package="NMsim") 
NMwriteInits(file.mod,
values=list( "theta(2)"=list(init=1.4),
             "THETA(3)"=list(FIX=1),
             "omega(2,2)"=list(init=0.1))
)
NMwriteInits(file.mod,
  "theta(2)"=list(init=1.4),
  "THETA(3)"=list(FIX=1),
  "omega(2,2)"=list(init=0.1)
)
} # }