Motivation
To be used in health economic analyses, model modules need to be called using a programming syntax. Ideally that syntax should be relatively simple, with the name and description of each command reliably communicating the category of operations it performs.
Implementation
ready4 provides a simple syntax that is used by all
model modules developed with the ready4
framework.
Use
A table that itemises ready4 commands along with
examples of how these commands are used can be ingested from a
periodically updated database using get_methods_tb. In the
below example we will search for examples of where that syntax has been
used by modules from the readyforwhatsnext model. The
value supplied to the gh_repo_1L_chr argument specifies the
repository in which a dataset of readyforwhatsnext module libraries is
stored.
x <- get_methods_tb(gh_repo_1L_chr = "ready4-dev/ready4")## ⠙ 10 items, page 1 | 3ms
Core commands
A HTML table of ready4’s core commands and examples of
the use of each command can be displayed using the
print_methods function, using the
return_1L_chr = "core" argument.
print_methods(x,
return_1L_chr = "core",
scroll_width_1L_chr = "100%") | Method | Purpose | Examples |
|---|---|---|
| author | Create and save reusable artefacts | |
| characterize | Generate descriptive summaries | |
| depict | Visualise object features | 5 , 13 , 14 , 16, 18 , 20 |
| enhance | Extend an object’s structure | 18, 19, 20 |
| exhibit | Display object contents | 3 , 13 , 14 , 16 |
| ingest | Import external data | 2 , 3 , 4 , 5 , 13 , 14 , 16 |
| investigate | Investigate inverse problems | |
| manufacture | Create a derived object | 19 |
| metamorphose | Transform a Ready4 object into another Ready4 object | |
| procure | Retrieve information from an object | 18, 19, 20 |
| prognosticate | Generate predictions | |
| ratify | Validate and reconcile object contents | 16, 18 , 20 |
| reckon | Compute derived quantities | |
| renew | Update object contents | 2 , 3 , 5 , 13 , 14 , 16, 19 |
| share | Share data or outputs | 2 , 13 , 14 , 16 |
Applying commands to module “slots”
Each of the “core” commands also has a “slot” version, which applies the command to a specified slot (a named element of a module). Two of these “slot” methods can also be used for additional purposes:
procureSlot is a “getter” method - its default behaviour is to return the value of a specified slot. If the argument
use_procure_mthd_1L_lgl = Tis included in the method call,procureSlotwill instead apply theprocuremethod to a specified slot.renewSlot is a “setter” method - if any value other than “use_renew_mthd” (the default) is passed to the
new_val_xxargument, that value will be assigned to the specified slot.
A HTML table of slot commands and relevant examples can be displayed
using the print_methods function, using the
return_1L_chr = "slot" argument.
print_methods(x,
return_1L_chr = "slot",
scroll_width_1L_chr = "100%")| Method | Purpose | Examples |
|---|---|---|
| authorSlot | Apply the author method to a specified slot | |
| characterizeSlot | Apply the characterize method to a specified slot | |
| depictSlot | Apply the depict method to a specified slot | |
| enhanceSlot | Apply the enhance method to a specified slot | |
| exhibitSlot | Apply the exhibit method to a specified slot | 1 |
| ingestSlot | Apply the ingest method to a specified slot | |
| investigateSlot | Apply the investigate method to a specified slot | |
| manufactureSlot | Apply the manufacture method to a specified slot | |
| metamorphoseSlot | Apply the metamorphose method to a specified slot | |
| procureSlot | Retrieve the value stored in a specified slot | 1, 5 , 13 |
| prognosticateSlot | Apply the prognosticate method to a specified slot | |
| ratifySlot | Apply the ratify method to a specified slot | |
| reckonSlot | Apply the reckon method to a specified slot | |
| renewSlot | Update the value stored in a specified slot | 1, 5 , 13 |
| shareSlot | Apply the share method to a specified slot |
Extended commands
Finally, there are a small number of other commands that are more
general extensions of the core commands. Currently, these extended
commands are all variants on the author command, with each
extension specifying the type of output to be authored by the method. A
HTML table of the extended generics bundled with ready4 can
be displayed using the print_methods function, using the
return_1L_chr = "extended" argument.
print_methods(x,
exclude_mthds_for_chr = "Ready4",
return_1L_chr = "extended",
scroll_width_1L_chr = "100%")| Method | Purpose | Examples |
|---|---|---|
| authorClasses | Create and document classes | |
| authorData | Create and document datasets | 1 |
| authorFunctions | Create and document functions | |
| authorReport | Create reports | 1 |
