Creates new model object by specifying relevant information as arguments. Also creates necessary YAML file for using functions like add_tags() and run_log() later. Will look for an associated model file (control stream) on disk and throw an error if it doesn't find one.

new_model(
  .path,
  .description = NULL,
  .based_on = NULL,
  .tags = NULL,
  .bbi_args = NULL,
  .overwrite = FALSE,
  .star = NULL,
  .model_type = c("nonmem")
)

Arguments

.path

Path to save the new model. Will be the path to the model file and YAML file (both without extension), and the path to the output directory.

.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

Character scalar or vector of paths to other models that this model was "based on." These are used to reconstuct model developement and ancestry. Paths must be relative to .yaml_path.

.tags

A character scalar or vector with any user tags to be added to the YAML file

.bbi_args

A named list specifying arguments to pass to bbi formatted like list("nm_version" = "nm74gf_nmfe", "json" = T, "threads" = 4). Run print_bbi_args() to see valid arguments. These will be written into YAML file.

.overwrite

If FALSE, the default, error if a file already exists at .yaml_path. If TRUE overwrite existing file and output directory, if they exist.

.star

Boolean, marks model to indicate special interest level.

.model_type

Character scaler to specify type of model being created (used for S3 class). Currently only 'nonmem' is supported by bbr itself, although other types may be implemented by other packages.

Value

S3 object of class bbi_{.model_type}_model that can be passed to submit_model(), model_summary(), etc.