Finding Applied Examples of Ready4 Modules and Sub-modules"

knitr::opts_chunk$set(echo = TRUE, warning = FALSE)
library(ready4)

Motivation

When considering whether to use a model module, it is useful to first see tutorials about appropriate use of that module.

Implementation

A table itemising individual model modules and sub-modules authored with ready4 can be generated using make_modules_tb. This function scrapes relevant data from the websites of module libraries that have been developed within a specified project's GitHub organisation.

Use

In this example, we are going to examine 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. Note, the following command may take a couple of minutes to execute.

modules_tb <- make_modules_tb(gh_repo_1L_chr = "ready4-dev/ready4")

A slightly quicker method to achieve a similar result is to use the get_modules_tb function. This function retrieves an archived version (and therefore potentially less up to date) of the modules summary table.

# Not run
# modules_tb <- get_modules_tb(gh_repo_1L_chr = "ready4-dev/ready4")

The modules_tb object itemises both model modules (which always use R's "S4" class type) and sub-modules ("S3" class type).

To display a HTML summary of just model modules, you can use the print_modules function.

print_modules(modules_tb, what_1L_chr = "S4")
print_modules(modules_tb, what_1L_chr = "S4")

You can use the same function to display only model sub-modules.

print_modules(modules_tb, what_1L_chr = "S3")
print_modules(modules_tb, what_1L_chr = "S3")

Related content

Details of how to search for themed collections of modules is described in another article.



Try the ready4 package in your browser

Any scripts or data that you put into this service are public.

ready4 documentation built on Sept. 30, 2024, 9:12 a.m.