modify_tags: Modify tags on a model object

modify_tagsR Documentation

Modify tags on a model object

Description

Add, replace, or remove tags on a model object and corresponding YAML. Tags can be modified at any time (i.e. before or after a model is submitted).

Usage

add_tags(.mod, .tags)

replace_tag(.mod, .old_tag, .new_tag)

replace_all_tags(.mod, .tags)

remove_tags(.mod, .tags)

Arguments

.mod

The ⁠bbi_{.model_type}_model⁠ object to modify

.tags

Character vector of tags to add or remove

.old_tag

Character scalar of tag to be replaced

.new_tag

Character scalar of tag that will be added

Details

The tags fields on a ⁠bbi_{.model_type}_model⁠ object contains a character vector of brief descriptors about the model. Often this is used to keep track of the model structure, such as the covariates or error stucture that was used.

One of the more useful things to do with tags is to use them for filtering a bbi_run_log_df (the tibble output from run_log()); for example to look at all models that used a particular random effect or covariate. To facilitate this, it is recommended to keep individual tags consistent and short, and/or to use a "glossary" of acceptable tags, stored elsewhere in your project (i.e. in a .yaml or .csv or a named list that you can source). In other words, if you tag one model with "CLAGE" and another with "ClearanceAgeCov", etc. then it will be very difficult to make any use of those tags later, for instance when you want to filter to models with that covariate.

Tags can also be collapsed using collapse_to_string() to create a compact description of the model stucture. See the "Getting Started" vignette for an example of this.

Value

The modified ⁠bbi_{.model_type}_model⁠ object

Functions

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

  • replace_tag(): Replaces a specific .old_tag with .new_tag on a model object and corresponding YAML. Warns and does nothing if .old_tag is not present.

  • replace_all_tags(): Replaces all tags on a model object and corresponding YAML with new tags.

  • remove_tags(): Removes tags from a model object and corresponding YAML.

See Also

run_log() collapse_to_string() modify_notes() modify_based_on() modify_description() modify_bbi_args() modify_star()


metrumresearchgroup/rbabylon documentation built on April 21, 2024, 3:26 a.m.