copy_model_from.Rd
Create new model by copying existing model. Useful for iterating during model
development. Also fills based_on
field by default, for constructing model
ancestry. See "Using based_on field" vignette for details.
copy_model_from( .parent_mod, .new_model, .description = NULL, .based_on_additional = NULL, .add_tags = NULL, .inherit_tags = FALSE, .update_model_file = TRUE, .overwrite = FALSE ) # S3 method for bbi_nonmem_model copy_model_from( .parent_mod, .new_model, .description = NULL, .based_on_additional = NULL, .add_tags = NULL, .inherit_tags = FALSE, .update_model_file = TRUE, .overwrite = FALSE )
.parent_mod | Model to copy from |
---|---|
.new_model | Path to the new model, either absolute or relative to the
path to |
.description | Character scalar description of new model run. This will
be stored in the yaml (and can be viewed later in |
.based_on_additional | Character vector of path(s) to other models that
this model was "based on." These are used to reconstuct model developement
and ancestry. Paths must be relative to |
.add_tags | Character vector with any new tags(s) to be added to
|
.inherit_tags | If |
.update_model_file | If |
.overwrite | If |
bbi_nonmem_model
: .parent_mod
takes a bbi_nonmem_model
object to use as a basis for the copy.
if (FALSE) { parent <- read_model("/foo/parent") # create model file at /bar/child.ctl and YAML at /bar/child.yaml copy_model_from(parent, "/bar/child", "child model with absolute path") # create model file at /foo/child.ctl and YAML at /foo/child.yaml copy_model_from(parent, "child", "relative to parent model path") mod1 <- read_model("/path/to/1") # create model file at /path/to/2.ctl and YAML at /path/to/2.yaml copy_model_from(mod1, 2, "numeric input works") # create model file at /path/to/100.1.ctl and YAML at /path/to/100.1.yaml copy_model_from(mod1, 100.1, "a period is okay") }