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 authoring collections of modules for the ready4 youth mental health systems model and disseminating them 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 andpkgdowngenerated 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
usethisgenerated GPL-3 license); - Quality assured (using continuous integration via GitHub actions and R-CMD-Check); and
- Versioned (applying
usethisversion increments).
ready4pack builds on both third party development workflow tools (such as devtools) and ready4 tools for authoring functions (ready4fun) and classes (ready4class). ready4pack integrates these tools in a common workflow, while adding tools for authoring and documenting R package datasets.
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
ready4showpackage CITATION, DESCRIPTION, LICENSE and README files; -
the
ready4showpackage website; -
two versions of the
ready4showpackage manual - a slimmed down version for end-users and a more detailed inventory of contents intended for developers; -
an initial
ready4showrelease for hosting supporting files, the creation of which will trigger archiving on Zenodo with aready4showpackage DOI; and -
an R-CMD-check continuous integration algorithm to be implemented each time a new version of
ready4showis pushed to themainbranch 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
youthvarspackage CITATION, DESCRIPTION, LICENSE and README files; -
the
youthvarspackage website; -
two versions of the
youthvarspackage manual - a slimmed down version for end-users and a more detailed inventory of contents intended for developers; -
an initial
youthvarsrelease for hosting supporting files, the creation of which will trigger archiving on Zenodo with ayouthvarspackage DOI; and -
an R-CMD-check continuous integration algorithm to be implemented each time a new version of
youthvarsis pushed to themainbranch of the GitHub source code repository.
Future documentation
A more detailed guide to using ready4pack will be created in 2023.