Dissemating citable, documented and quality assured model module libraries
Categories:
This below section renders a vignette article from the ready4pack library. You can use the following links to:
- view the vignette on the library website (adds useful hyperlinks to code blocks)
- view the source file from that article, and;
- edit its contents (requires a GitHub account).
ready4pack
is a toolkit for bundling collections of modules for computational health economic models authored with the ready4 framework as R packages that are:
- Citable (with a Zenodo generated DOI and an algorithm generated CITATION file);
- Community-minded (applying deprecation conventions supported by
lifecycle
); - Documented (applying a function self-documenting algorithm that extends
sinew
, deploying a GitHub pages hosted andpkgdown
generated website and authoring PDF manuals stored in a GitHub Release viapiggyback
); - Internally consistent implementing automated checks to ensure consistency in naming conventions, etc;
- Licensed (via a
usethis
generated GPL-3 license); - Quality assured (using continuous integration via GitHub actions and R-CMD-Check); and
- Versioned (applying
usethis
version increments).
ready4pack
extends ready4 framework tools for authoring module algorithms (ready4fun) and data structures (ready4class) and wraps functions from a number of third party R development workflow tools (such as devtools
). ready4pack
integrates these tools in a common workflow, while adding tools for authoring and documenting datasets to be shipped with model module R packages.
A combination of the ready4_pack_manifest
class and author
method are used to implement this workflow. This workflow has been used to author all public versions of the ready4 R packages available in the ready4 github repository.
Workflow
Manifest
The main class exported as part of ready4pack
is readypack_manifest
list based ready4 sub-module, that extends the ready4fun_manifest
and ready4class_manifest
sub-modules.
Typical usage
readypack_manifest
sub-module is most efficiently created with the aid of the make_pt_ready4pack_manifest
function and combines instances of the ready4fun_manifest
and ready4class_constructor
sub-modules.
x <- make_pt_ready4pack_manifest(ready4fun::ready4fun_manifest(),
constructor_r3 = ready4class::ready4class_constructor()) %>%
ready4pack_manifest()
The main method defined for readypack_manifest
is author
which extends the author
method for ready4class_manifest
to author a consistently documented R package.
## Not run
author(x)
Examples
Workflow example one
The program to author and document the ready4show package is relatively simple and authors:
-
the
ready4show
package CITATION, DESCRIPTION, LICENSE and README files; -
the
ready4show
package website; -
two versions of the
ready4show
package manual - a slimmed down version for end-users and a more detailed inventory of contents intended for developers; -
an initial
ready4show
release for hosting supporting files, the creation of which will trigger archiving on Zenodo with aready4show
package DOI; and -
an R-CMD-check continuous integration algorithm to be implemented each time a new version of
ready4show
is pushed to themain
branch of the GitHub source code repository.
Workflow example two
The program to author and document the youthvars package is a bit more complex as it includes syntax to create package datasets. In addition to the package datasets, the algorithm creates content corresponding to the previous example, specifically:
-
the
youthvars
package CITATION, DESCRIPTION, LICENSE and README files; -
the
youthvars
package website; -
two versions of the
youthvars
package manual - a slimmed down version for end-users and a more detailed inventory of contents intended for developers; -
an initial
youthvars
release for hosting supporting files, the creation of which will trigger archiving on Zenodo with ayouthvars
package DOI; and -
an R-CMD-check continuous integration algorithm to be implemented each time a new version of
youthvars
is pushed to themain
branch of the GitHub source code repository.
Future documentation
A more detailed guide to using ready4pack
will be created in 2023.