# Deterministic SIR model with varying act rate
mod <- epiDCM(type="SIR", s.num=1000, i.num=1, r.num=0,
trans.rate=0.2, act.rate=1:10, rec.rate=1/3,
b.rate=0.011, ds.rate=0.01, di.rate=0.03,
dr.rate=0.01, nsteps=500, verbose=TRUE)
# Plot disease prevalence by default
plot(mod)
# Plot prevalence of susceptibles
plot(mod, y="s.num", col="Greys")
# Plot number of susceptibles
plot(mod, y="s.num", popfrac=FALSE, col="Greys")
# One way to plot multiple runs of multiple compartments together
plot(mod, y=c("s.num", "i.num"), run=5, xlim=c(0,200))
plot(mod, y=c("s.num", "i.num"), run=10, alpha=0.3, leg="n", add=TRUE)
Run the code above in your browser using DataLab