plot.SimBIID_runs {SimBIID} | R Documentation |
Plots SimBIID_runs
objects
Description
Plot method for SimBIID_runs
objects.
Usage
## S3 method for class 'SimBIID_runs'
plot(
x,
which = c("all", "t"),
type = c("runs", "sums"),
rep = NA,
quant = 0.9,
data = NULL,
matchData = NULL,
...
)
Arguments
x |
An |
which |
A character vector of states to plot. Can be |
type |
Character stating whether to plot full simulations over time ( |
rep |
An integer vector of simulation runs to plot. |
quant |
A vector of quantiles (> 0.5) to plot if |
data |
A |
matchData |
A character vector containing matches between the columns of |
... |
Not used here. |
Value
A plot of individual simulations and/or summaries of repeated simulations
extracted from SimBIID_runs
object.
See Also
mparseRcpp
, print.SimBIID_runs
, run
Examples
## set up SIR simulation model
transitions <- c(
"S -> beta * S * I -> I",
"I -> gamma * I -> R"
)
compartments <- c("S", "I", "R")
pars <- c("beta", "gamma")
model <- mparseRcpp(
transitions = transitions,
compartments = compartments,
pars = pars,
tspan = TRUE
)
## run 100 replicate simulations and
## plot outputs
sims <- run(
model = model,
pars = c(beta = 0.001, gamma = 0.1),
tstart = 0,
tstop = 100,
u = c(S = 119, I = 1, R = 0),
tspan = seq(1, 100, length.out = 10),
nrep = 100
)
plot(sims, quant = c(0.55, 0.75, 0.9))
## add replicate 1 to plot
plot(sims, quant = c(0.55, 0.75, 0.9), rep = 1)