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
+40-7Lines changed: 40 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,16 +56,45 @@ renv::snapshot()
56
56
57
57
The simulation code is in the `R/` folder as a local package. There are files executing the model and analysing the results in `rmarkdown/`.
58
58
59
-
To run the model with base parameters once or with replications:
59
+
**Install the local package:**
60
60
61
61
```{.r}
62
-
# TODO
62
+
devtools::install() # Needed if running in parallel
63
+
devtools::load_all() # Sufficient if running sequentially
64
+
65
+
library(simulation)
66
+
```
67
+
68
+
**Run a single simulation:**
69
+
70
+
```{.r}
71
+
param <- create_parameters(number_of_runs = 1L)
72
+
single_results <- runner(param = param)
63
73
```
64
74
65
-
Example altering the model parameters:
75
+
**Run multiple replications:**
66
76
67
77
```{.r}
68
-
# TODO
78
+
param <- create_parameters(number_of_runs = 5L)
79
+
single_results <- runner(param = param)
80
+
```
81
+
82
+
**Run all analyses (from command line):**
83
+
84
+
```{.r}
85
+
bash run_rmarkdown.sh
86
+
```
87
+
88
+
**Run tests:**
89
+
90
+
```{.r}
91
+
devtools::test()
92
+
```
93
+
94
+
**Lint code:**
95
+
96
+
```{.r}
97
+
lintr::lint_dir()
69
98
```
70
99
71
100
### Generating the results from the article
@@ -87,23 +116,27 @@ To generate these, simply execute `rmarkdown/analysis.Rmd`.
87
116
88
117
Original:
89
118
119
+

120
+
90
121
From this repository:
91
122
92
-
**TODO**
123
+

93
124
94
125
**Figure 3**
95
126
96
127
Original:
97
128
129
+

130
+
98
131
From this repository:
99
132
100
-
**TODO**
133
+

101
134
102
135
<br>
103
136
104
137
## Run time and machine specification
105
138
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.
139
+
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.
107
140
108
141
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.
0 commit comments