Skip to content

Commit

Permalink
#133 - Rough draft of admiral options snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
Zelos Zhu committed Oct 27, 2022
1 parent a253b99 commit f8b9e2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Expand Up @@ -10,7 +10,7 @@ articles:
release_strategy: release_strategy.html
unit_test_guidance: unit_test_guidance.html
writing_vignettes: writing_vignettes.html
last_built: 2022-10-20T00:25Z
last_built: 2022-10-27T20:11Z
urls:
reference: https://pharmaverse.github.io/admiraldev/devel/reference
article: https://pharmaverse.github.io/admiraldev/devel/articles
Expand Down
4 changes: 3 additions & 1 deletion vignettes/programming_strategy.Rmd
Expand Up @@ -100,7 +100,9 @@ i.e. all input like datasets, variable names, options, … must be provided to t
* If the function needs to create temporary variables in an input dataset, these
variables must start with `temp_` and must be removed from the output dataset.
* If the input dataset includes variables starting with `temp_`, an error must be issued.
* The function must not have any side-effects like creating or modifying global objects, printing, writing files, ...
* In general, the function must not have any side-effects like creating or modifying global objects, printing, writing files, ...
* An exception is made for admiral options, see `get_admiral_option()` and `set_admiral_options()`, where we have certain pre-defined defaults with added flexibility to allow for user-defined defaults on *commonly used* function arguments e.g. `subject_keys` currently pre-defined as `vars(STUDYID, USUBJID)`, but can be modified using `set_admiral_options(subject_keys = vars(...))` at the top of a script. The reasoning behind this was to relieve the user of repeatedly changing aforementioned *commonly used* function arguments multiple times in a script, which may be called across many admiral functions.
* If this additional flexibility needs to be added for another *commonly used* function argument e.g. `future_input` to be set as `vars(...)` it can be added as an admiral option. In the function formals define `future_input = get_admiral_option(future_input)` then proceed to modify the body and roxygen documentation of `set_admiral_options()`.

## Function Names

Expand Down

0 comments on commit f8b9e2c

Please sign in to comment.