-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
57 lines (39 loc) · 2.57 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
warning = F,
message = F,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# R6Sim
<!-- badges: start -->
[![R-CMD-check](https://github.com/RANDCorporation/R6Sim/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RANDCorporation/R6Sim/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
`R6Sim` provides an `R6` base class for simulation modeling analyses using the structure of encapsulated object-oriented programming provided by `R6`. This package allows one to create models that inherit `R6Sim`, and specify models and experimental designs that can use multiple models using the `R6Experiment` class.
# Why `R6Sim`
Simulation modeling projects performed in R often rely on poorly-designed code bases, where the modeler and others don't have visibility into what the model does and all the inputs the model needs to run. Often, there is a tight dependence on inputs that may live in the global environment, *or* the modeler tends to add a large set of function parameters that percolate through the code and are passed through several layers of functions. This can be problematic when one simply wants to inspect the totality of the inputs that are influencing model outputs, but those inputs live at several layers in the code.
One potential cause of those problems is the overuse of the functional programming paradigm in cases where an encapsulated object-oriented paradigm could be helpful. After building models in R for a few years, I arrived at this simple pattern where the model is an `R6` class, and there is another class (which I call an experiment), that can include one *or more* models, and can run those models. `R6Sim` is a package that helps implement this modeling pattern.
## Installation
You can install `R6Sim` like so:
``` r
# install the remotes package if you do not have it
# install.packages("remotes")
# install from github:
remotes::install_github("randcorporation/r6sim",build_vignettes = T)
```
## Usage
See the introductory vignette:
```{r eval=FALSE, include=T}
vignette("introduction", package = "R6Sim")
```
## Contact
Reach out to [Pedro Nascimento de Lima](https://www.rand.org/about/people/l/lima_pedro_nascimento_de.html) for questions related to this repository.
## License
Copyright (C) 2024 by The [RAND Corporation](https://www.rand.org). This repository is released as open-source software under a GPL-3 license. See the LICENSE.md file.