copy_model_from.RdCreate 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, .based_on_additional = NULL, .add_tags = NULL, .inherit_tags = FALSE, .update_model_file = TRUE, .overwrite = FALSE, .directory = get_model_directory() ) # S3 method for bbi_nonmem_model copy_model_from( .parent_mod, .new_model, .description, .based_on_additional = NULL, .add_tags = NULL, .inherit_tags = FALSE, .update_model_file = TRUE, .overwrite = FALSE, .directory = get_model_directory() ) # S3 method for character copy_model_from( .parent_mod, .new_model, .description, .based_on_additional = NULL, .add_tags = NULL, .inherit_tags = FALSE, .update_model_file = TRUE, .overwrite = FALSE, .directory = get_model_directory() ) # S3 method for numeric copy_model_from( .parent_mod, .new_model, .description, .based_on_additional = NULL, .add_tags = NULL, .inherit_tags = FALSE, .update_model_file = TRUE, .overwrite = FALSE, .directory = get_model_directory() )
| .parent_mod | Model to copy from |
|---|---|
| .new_model | Path to write new model files to WITHOUT FILE EXTENSION. Function will create both |
| .description | Description of new model run. This will be stored in the yaml (to be used 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 |
| .directory | Model directory which |
bbi_nonmem_model: .parent_mod takes a bbi_nonmem_model object to use as a basis for the copy.
character: Takes a file path to parent model to use as a basis for the copy. Ideally a YAML path, but can also pass control stream or output directory.
Can be absolute or relative to .directory, which defaults to options('rbabylon.model_directory').
numeric: Both .parent_mod and .new_model take integers which must correspond to a model file name (without extension obviously).
This will only work if you are calling from the same directory as the models, or if you have set options('rbabylon.model_directory') to the directory constaining the relevant models.