Helper functions for updating fields in a bbi_{.model_type}_model object. Note that calling modify_model_field() directly is not recommended for most users because it requires knowing about the internal structure of the model object. Instead we recommend using the friendlier helpers listed below (add_... or replace_...) when possible.

modify_model_field(.mod, .field, .value, .append = TRUE, .unique = TRUE)

add_tags(.mod, .tags)

replace_tags(.mod, .tags)

add_decisions(.mod, .decisions)

replace_decisions(.mod, .decisions)

add_based_on(.mod, .based_on)

replace_based_on(.mod, .based_on)

replace_description(.mod, .description)

add_bbi_args(.mod, .bbi_args)

replace_bbi_args(.mod, .bbi_args)

Arguments

.mod

The bbi_{.model_type}_model object to modify

.field

Character scalar of the name of the component to modify

.value

Whatever is to be added to .mod[[.field]], typically a character vector

.append

If TRUE, the default, concatenate new values with currently present values. If FALSE, new values will overwrite old values.

.unique

If TRUE, the default, de-duplicate .mod[[.field]] after adding new values. If FALSE duplicate values will be kept.

.tags

Character vector to add to tags field

.decisions

Character vector to use as replacement

.based_on

Character vector of relative paths to add to based_on field

.description

Character scalar to use as replacement for the description field

.bbi_args

named list of arguments to add to the model

Details

All functions in this family also check the object against the corresponding YAML with check_yaml_in_sync() before modifying it, and errors if they are out of sync. After the object has been modified they will write the modified object back to the YAML and update the model object in memory with an md5 digest of the newly written YAML.

Functions

  • add_tags: Add tags to a model object and corresponding YAML

  • replace_tags: Replaces tags on a model object and corresponding YAML with new tags

  • add_decisions: Append new decisions to the one(s) in a model object and corresponding YAML

  • replace_decisions: Replaces decisions field in a model object and corresponding YAML with new values

  • add_based_on: Append new based_on tag to the one in a model object and corresponding YAML

  • replace_based_on: Replaces based_on field in a model object and corresponding YAML with new values

  • replace_description: Replaces description field in a model object and corresponding YAML with new description

  • add_bbi_args: Modifies model object and corresponding YAML by adding new bbi_args, overwriting any args that are already present with the new values. Use print_nonmem_args() to see a list of valid babylon arguments.

  • replace_bbi_args: Modifies model object and corresponding YAML by replacing bbi_args with new list passed to .bbi_args. Use print_nonmem_args() to see a list of valid babylon arguments.