Skip to content

Commit 177f2fa

Browse files
committed
docs(readme/article): add article + update README with figures and run commands
1 parent 7de0975 commit 177f2fa

File tree

8 files changed

+38
-10
lines changed

8 files changed

+38
-10
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ vignettes/*.pdf
3939
# R Environment Variables
4040
.Renviron
4141

42-
# pkgdown site
43-
docs/
44-
4542
# translation temp files
4643
po/*~
4744

README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,43 @@ renv::snapshot()
5656

5757
The simulation code is in the `R/` folder as a local package. There are files executing the model and analysing the results in `rmarkdown/`.
5858

59-
To run the model with base parameters once or with replications:
59+
**Install the local package:**
6060

6161
```{.r}
62-
# TODO
62+
devtools::install()
63+
library(simulation)
6364
```
6465

65-
Example altering the model parameters:
66+
**Run a single simulation:**
6667

6768
```{.r}
68-
# TODO
69+
param <- create_parameters(number_of_runs = 1L)
70+
single_results <- runner(param = param)
71+
```
72+
73+
**Run multiple replications:**
74+
75+
```{.r}
76+
param <- create_parameters(number_of_runs = 5L)
77+
single_results <- runner(param = param)
78+
```
79+
80+
**Run all analyses (from command line):**
81+
82+
```{.r}
83+
bash run_rmarkdown.sh
84+
```
85+
86+
**Run tests:**
87+
88+
```{.r}
89+
devtools::test()
90+
```
91+
92+
**Lint code:**
93+
94+
```{.r}
95+
lintr::lint_dir()
6996
```
7097

7198
### Generating the results from the article
@@ -87,23 +114,27 @@ To generate these, simply execute `rmarkdown/analysis.Rmd`.
87114

88115
Original:
89116

117+
![](docs/article/fig1.png)
118+
90119
From this repository:
91120

92-
**TODO**
121+
![](outputs/figure1_asu.png)
93122

94123
**Figure 3**
95124

96125
Original:
97126

127+
![](docs/article/fig3.png)
128+
98129
From this repository:
99130

100-
**TODO**
131+
![](outputs/figure3_asu.png)
101132

102133
<br>
103134

104135
## Run time and machine specification
105136

106-
The run time for this analysis (`notebooks/analysis.Rm`) is **TODO** seconds. This was on an Intel Core i7-12700H, 32GB RAM, Ubuntu 24.04.1.
137+
The run time for this analysis (`notebooks/analysis.Rmd`) is **1m 38s** seconds. This was on an Intel Core i7-12700H, 32GB RAM, Ubuntu 24.04.1.
107138

108139
The other notebooks generate results for tests and illustrate other functionality (e.g. importing parameters from csv, running with logs), and these just take a second or two.
109140

548 KB
Binary file not shown.

docs/article/fig1.png

24.4 KB
Loading

docs/article/fig2.png

58.5 KB
Loading

docs/article/fig3.png

22.9 KB
Loading
28.3 KB
Binary file not shown.
361 KB
Binary file not shown.

0 commit comments

Comments
 (0)