[Stable]

Similar to ctl_name() & run_in(), this allows you to retrieve and specify the relative path to the control file that will be written by the run_nm().

ctl_path(m, text)

Arguments

m

An nm object.

text

Optional character. Name of path to control file (see details). Typically, this file does not yet normally exist, but will house the code code for this run.

Value

character with path to NONMEM control file to be copied immediately prior to running (with run_nm()).

Details

Note that text can contain an "{run_id}" string. E.g. "Models/run{run_id}.mod" will use the name "Models/runm1.mod" if run_id(m1) is "m1".

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))


ctl_name(m1)
#> [1] "runm1.mod"
ctl_path(m1)
#> [1] "Models/runm1.mod"

m1 <- m1 %>% ctl_path("Models/nm_{run_id}.ctl")
ctl_path(m1)
#> [1] "Models/nm_m1.ctl"