copy_model_from: Generic S3 method from iterating on models.

Description Usage Arguments Value

View source: R/copy-model-from.R

Description

Create new .mod/ctl and new .yaml files based on a previous model. Used for iterating on model development. Also fills in necessary YAML fields for using 'create_run_log()' later.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 class '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 class '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 class '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()
)

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

Arguments

.parent_mod

S3 object of class 'bbi_nonmem_model' to be used as the basis for copy.

.new_model

Integer that corresponds to the new model name to create. Function will create both '.new_model.yaml' and a new model file based on this path.

.description

Description of new model run. This will be stored in the yaml (to be used later in 'create_run_log()') and optionally passed into the '$PROBLEM' of the new control stream.

.based_on_additional

Character scaler 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 '.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

A character scaler or vector with any new tags to be added to '.new_model.yaml'

.inherit_tags

Boolean for whether to inherit any tags from '.parent_mod'

.update_model_file

Boolean for whether to update the '$PROBLEM' line in the new control stream. By default it is TRUE, but if FALSE is passed '.new_model.[mod|ctl]' will be an exact copy of its parent control stream.

.overwrite

Boolean for whether to overwrite model file if one already exists specified '.new_model' path

.directory

Model directory which BOTH ‘.parent_model' and '.new_model' are relative to. Defaults to 'options(’rbabylon.model_directory')', which can be set globally with 'set_model_directory()'.

Value

S3 object of class 'bbi_nonmem_model' that can be passed to 'submit_nonmem_model()'


metrumresearchgroup/mrgvalidatetestreference documentation built on Aug. 15, 2021, 8:13 a.m.