ctl_path: Get and set path to NONMEM control file

View source: R/nm-gettersetters.R

ctl_pathR Documentation

Get and set path to NONMEM control file

Description

[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().

Usage

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.

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".

Value

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

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)
ctl_path(m1)

m1 <- m1 %>% ctl_path("Models/nm_{run_id}.ctl")
ctl_path(m1)



tsahota/NMproject documentation built on Oct. 1, 2022, 11:51 a.m.