Description Usage Arguments Details Value Examples
This function will start the simulation. Use the printing method as long as you are testing the scenario.
1 2 3 4 5 6 7 8 9 10 11 |
x |
a |
R |
number of repetitions. |
path |
optional path in which the simulation results can be saved. They
will we coerced to a |
overwrite |
|
... |
arguments passed to |
suffix |
an optional suffix of file names. |
fileExt |
the file extension. Default is ".csv" - alternative it can be ".RData". |
libs |
arguments passed to |
exports |
arguments passed to |
The package parallelMap is utilized as back-end for parallel computations.
Use the argument path
to store the simulation results in a directory.
This may be a good idea for long running simulations and for those using
large data.frame
s. You can use sim_read_data
to read
them in. The return value will change to NULL in each run.
The return value is a list. The elements are the results of each
simulation run, typically of class data.frame
. In case you specified
path
, each element is NULL
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | setup <- sim_base_lm()
resultList <- sim(setup, R = 1)
# For parallel computations you may need to export objects
localFun <- function() cat("Hello World!")
comp_fun <- function(dat) {
localFun()
dat
}
res <- sim_base_lm() %>%
sim_comp_pop(comp_fun) %>%
sim(R = 2,
mode = "socket", cpus = 2,
exports = "localFun")
str(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.