Like bbr::copy_model_from(), but switch the model type from "nonmem" to "nmbayes" to begin defining a NONMEM Bayes model.

copy_model_as_nmbayes(
  .parent_mod,
  .new_model = NULL,
  .description = NULL,
  .based_on_additional = NULL,
  .add_tags = NULL,
  .star = NULL,
  .inherit_tags = FALSE,
  .update_model_file = TRUE,
  .overwrite = FALSE
)

Arguments

.parent_mod

A bbi_nonmem_model object to copy. This should not be a bbi_nmbayes_model subclass; in that case, use bbr::copy_model_from() to copy the model in the standard way.

.new_model

Path to the new model, either absolute or relative to the path to .parent_mod. Represents an absolute model path, which is the path to the YAML file and model file, both without extension, and the output directory (once the model is run). Numeric values will be coerced to character. If NULL, the default, will try to increment to the next integer in the destination directory. See examples for usage.

.description

Character scalar description of new model run. This will be stored in the yaml (and can be viewed later in run_log()).

.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 .new_model path. Note that the .parent_model will automatically be added to the based_on field, so no need to include that here.

.add_tags

Character vector with any new tags(s) to be added to {.new_model}.yaml

.star

Boolean, marks model to indicate special interest level.

.inherit_tags

If FALSE, the default, new model will only have any tags passed to .add_tags argument. If TRUE inherit any tags from .parent_mod, with any tags passed to .add_tags appended.

.update_model_file

Whether to update the newly created model file. If TRUE, the model will be adjusted by copy_model_from(). In addition, any existing estimation records will be deleted, and the two estimation records required for nmbayes models will be added along with a comment.

.overwrite

If FALSE, the default, function will error if a model file already exists at specified .new_model path. If TRUE any existing file at .new_model will be overwritten silently.

Value

A bbi_nmbayes_model object for the new model.

See also

bbr_nmbayes for a high-level description of how NONMEM Bayes models are structured in bbr