You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ This repository provides a template for building discrete-event simulation (DES)
46
46
47
47
✨ **Design practices:** Functions are documented with `roxygen2` docstrings and `lintr` is used to lint `.R` and `.Rmd` files.
48
48
49
-
🧱 **Package structure:** The simulation code (`R/`) is structured as a little local R package. It is installed in our environment using `devtools::install()` and then `library(simulation)`. This means it can easily be used anywhere else in the directory - here, in `notebooks/` and `tests/` - without needing any additional code (e.g. no need to run `source()` with paths to the files).
49
+
🧱 **Package structure:** The simulation code (`R/`) is structured as a little local R package. It is installed in our environment using `devtools::install()` and then `library(simulation)`. This means it can easily be used anywhere else in the directory - here, in `rmarkdown/` and `tests/` - without needing any additional code (e.g. no need to run `source()` with paths to the files).
50
50
51
51
<detailsmarkdown="1">
52
52
<summary><b>More information about the package structure</b></summary>
@@ -57,7 +57,7 @@ This repository provides a template for building discrete-event simulation (DES)
57
57
58
58
* Encourages well-organised repository following **standardised** established R package structure, which ensures that the model and analysis code are kept seperate.
59
59
* Useful "built-in" features like **tests**, documentation of functions using **Roxygen**, documentation of data, and **package checks** (e.g. checking all imports are declared).
60
-
* If your analysis has a short run time, the `.Rmd` files could be stored in a `vignettes/` folder which will mean they **re-run with every package build/check**, and so any new run issues will be identified. However, in this project, the analysis was instead stored in `notebooks/` as the file paths to save outputs cause errors in `vignettes/` (as they will differ between your runs of the notebook, and runs during the package build process).
60
+
* If your analysis has a short run time, the `.Rmd` files could be stored in a `vignettes/` folder which will mean they **re-run with every package build/check**, and so any new run issues will be identified. However, in this project, the analysis was instead stored in `rmarkdown/` as the file paths to save outputs cause errors in `vignettes/` (as they will differ between your runs of the notebook, and runs during the package build process).
61
61
* Meet packaging **requirement** on the NHS "Levels of RAP" framework.
62
62
63
63
For more information on the rationale behind structuring research as an R package, check out:
🔎 Choose your desired licence (e.g. <https://choosealicense.com/>). If keeping an MIT licence, just modify the copyright holder in `LICENSE` and `LICENSE.md`.
158
158
159
-
🔎 Review the example DES implementation in `R/` and `notebooks/`. Modify and extend the code as needed for your specific use case.
159
+
🔎 Review the example DES implementation in `R/` and `rmarkdown/`. Modify and extend the code as needed for your specific use case.
160
160
161
161
🔎 Check you still fulfil the criteria in `docs/nhs_rap.md` and `docs/heather_2025.md`.
162
162
@@ -188,10 +188,10 @@ You can lint the `.R` and `.Rmd` files by running:
188
188
189
189
```
190
190
lintr::lint_package()
191
-
lintr::lint_dir("notebooks")
191
+
lintr::lint_dir("rmarkdown")
192
192
```
193
193
194
-
The `lint_package()` function will run on files typically included in a package (i.e. `R/`, `tests/`). This will not include `notebooks/` as it is not typical/excluded from our package build, and so we can lint that by specifying the directory for `lint_dir()`.
194
+
The `lint_package()` function will run on files typically included in a package (i.e. `R/`, `tests/`). This will not include `rmarkdown/` as it is not typical/excluded from our package build, and so we can lint that by specifying the directory for `lint_dir()`.
195
195
196
196
<br>
197
197
@@ -211,10 +211,10 @@ repo/
211
211
├── docs/ # Documentation
212
212
├── images/ # Image files and GIFs
213
213
├── man/ # Function documentation generated by roxygen
214
-
├── notebooks/ # Run DES model and analyse results
215
214
├── outputs/ # Folder to save any outputs from model
216
215
├── R/ # Local package containing code for the DES model
217
216
├── renv/ # Instructions for creation of R environment
217
+
├── rmarkdown/ # .Rmd files to run DES model and analyse results
218
218
├── tests/ # Unit and back testing of the DES model
219
219
├── .gitignore # Untracked files
220
220
├── .lintr # Lintr settings
@@ -236,7 +236,7 @@ repo/
236
236
237
237
## ⏰ Run time and machine specification
238
238
239
-
The overall run time will vary depending on how the template model is used. A few example implementations are provided in `notebooks/` and the run times for these were:
239
+
The overall run time will vary depending on how the template model is used. A few example implementations are provided in `rmarkdown/` and the run times for these were:
0 commit comments