Description Usage Arguments Value Examples
A scenario folder is where you organise and store the scripts, the data and the models that associate with a microsimulation model implementation. This is a recommended practice for dymium models.
create_scenario
: creates a scenario folder inside the scenarios
folder, which
will be created if not already exists, at the root folder of your active RStudio
project. The standard structure of a scenario folder contains an 'inputs' folder,
an 'outputs' folder inside. However, if the scenario is already existed then it
this will set that scenario to active
if active
is TRUE
. When you call a
dymium function such as dm_save
, it will automatically save the data to the
outputs
folder of the currently active scenario.
set_active_scenario
: is useful for event functions to access the current
active scenario directory. If the scenerio folder doesn't have 'inputs' and
'ouputs' folders then they will be created.
get_active_scenario
: returns a list of 3 elements: 'scenario, 'inputs' and
'outputs' directories.
1 2 3 4 5 | create_scenario(name, active = TRUE, .basedir = here::here())
set_active_scenario(name, .basedir = here::here())
get_active_scenario()
|
name |
:: |
active |
:: |
.basedir |
:: |
create_
and set_
invisibly returns the scenario path and get_
returns a named list.
1 2 3 4 5 6 | ## Not run:
create_scenario(name = "test", active = FALSE)
set_active_scenario(name = "test")
get_active_scenario()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.