Child objects inherit attributes of parent but with a new run_id. The control
file will be inherited too with $TABLEs updated.
child(m, run_id = NA_character_, type = "execute", parent = m, silent = FALSE)Parent nm object.
Character. New run_id to assign to child object.
Character (default = "execute"). Type of child object.
Optional nm object (default = m) . Parent object will by
default be m, but this argument will force parent to be a different
object.
Logical (default = FALSE). Should warn if conflicts detected.
An new nm object with modified parent_* fields updated to be the
* fields of the parent object, m.
Specifying parent will force parent to be different from m. This
is useful in piping when a parent object is modified prior to being used in
the child object.
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"))
m2 <- m1 %>% child("m2")
nm_diff(m2, m1)
#> < old_ctl
#> > new_ctl
#> @@ 1,3 / 1,3 @@
#> < ;; 1. Based on: NA
#> > ;; 1. Based on: m1
#> ;; 2. Description: 1CMT+oral
#> ;; x1. Author: runner
#> @@ 89,9 / 89,9 @@
#>
#> $TABLE ID TIME IPRED IWRES IRES CWRES NPDE
#> < FILE=sdtabm1 NOPRINT ONEHEADER
#> > FILE=sdtabm2 NOPRINT ONEHEADER
#> $TABLE ID ETAS(1:LAST); individual parameters
#> < FILE=patabm1 NOPRINT ONEHEADER
#> > FILE=patabm2 NOPRINT ONEHEADER
#> $TABLE ID ; continuous covariates
#> < FILE=cotabm1 NOPRINT ONEHEADER
#> > FILE=cotabm2 NOPRINT ONEHEADER
#> $TABLE ID ; categorical covariates
#> < FILE=catabm1 NOPRINT ONEHEADER
#> > FILE=catabm2 NOPRINT ONEHEADER