---
title: "Finding Libraries Of Ready4 Modules"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Finding Libraries Of Ready4 Modules}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE)
```
```{r message=FALSE, warning=F}
library(ready4) 
```

## Motivation
To use and combine health economic model modules it is first useful to find modules that have been developed using a common framework that promotes inter-operability.

## Implementation
A table summarising currently available module libraries authored with the [ready4 framework](https://www.ready4-dev.com/) within a specified GitHub organisation can be retrieved from an online dataset by using the `get_libraries_tb` and `update_libraries_tb` functions. 

## Use
In the below example we will search for modules from the [readyforwhatsnext model](https://readyforwhatsnext.org/). The source code for these modules all reside in the [ready4-dev GitHub repository](https://github.com/ready4-dev). The value supplied to the `gh_repo_1L_chr` argument specifies the repository in which a dataset of readyforwhatsnext module libraries is stored.

```{r}
libraries_tb <- get_libraries_tb(gh_repo_1L_chr = "ready4-dev/ready4") %>% update_libraries_tb(include_1L_chr = "modules", url_stub_1L_chr = "https://ready4-dev.github.io/")
```

In this example, module libraries have been grouped in to the following thematic model “sections”.

```{r}
libraries_tb$Section %>% unique()
```
We can use the `print_packages` function to display a HTML summary of the module libraries currently available for each section. The resulting table summarises the types of module library (e.g. those for description, developing models or predicting with models), the name and purpose of those libraries, the locations from which development and archived library code can be downloaded and details of supporting documentation for each library (e.g. website, manuals and examples).

```{r}
print_packages(libraries_tb, sections_chr = "People")
```

```{r}
print_packages(libraries_tb, sections_chr = "Places")
```

```{r}
print_packages(libraries_tb, sections_chr = "Programs")
```

## Related content
Details of how to search for details on individual modules is described in [another article](https://www.ready4-dev.com/docs/tutorials/use-models/finding-modules/modules/). 
