merge.icm | R Documentation |
Merges epidemiological data from two independent simulations of
stochastic individual contact models from icm
.
## S3 method for class 'icm'
merge(x, y, ...)
x |
An |
y |
Another |
... |
Additional merge arguments (not used). |
This merge function combines the results of two independent simulations of
icm
class models, simulated under separate function calls. The
model parameterization between the two calls must be exactly the same, except
for the number of simulations in each call. This allows for manual
parallelization of model simulations.
This merge function does not work the same as the default merge, which allows for a combined object where the structure differs between the input elements. Instead, the function checks that objects are identical in model parameterization in every respect (except number of simulations) and binds the results.
An EpiModel
object of class icm
containing the
data from both x
and y
.
param <- param.icm(inf.prob = 0.2, act.rate = 0.8)
init <- init.icm(s.num = 1000, i.num = 100)
control <- control.icm(type = "SI", nsteps = 10,
nsims = 3, verbose = FALSE)
x <- icm(param, init, control)
control <- control.icm(type = "SI", nsteps = 10,
nsims = 1, verbose = FALSE)
y <- icm(param, init, control)
z <- merge(x, y)
# Examine separate and merged data
as.data.frame(x)
as.data.frame(y)
as.data.frame(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.