| epiworld-history | R Documentation |
Functions to extract simulation history at total, variant, and tool levels, plus snapshot totals and a common plot method for history objects.
get_hist_total(x)
get_today_total(x)
## S3 method for class 'epiworld_hist'
plot(x, y, ...)
get_hist_virus(x)
get_hist_tool(x)
x |
An object of class |
y |
Ignored. |
... |
In the case of plot methods, further arguments passed to graphics::plot. |
The get_hist_total function returns an object of class
epiworld_hist_total.
The get_today_total function returns a named vector with the
total number of individuals in each state at the end of the simulation.
The get_hist_virus function returns an object of class
epiworld_hist_virus.
The get_hist_tool function returns an object of epiworld_hist_tool.
# SEIR Connected model
seirconn <- ModelSEIRCONN(
name = "Disease",
n = 10000,
prevalence = 0.1,
contact_rate = 2.0,
transmission_rate = 0.8,
incubation_days = 7.0,
recovery_rate = 0.3
)
# Running the simulation for 50 steps (days)
set.seed(937)
run(seirconn, 50)
# Retrieving date, state, and counts dataframe including any added tools
get_hist_tool(seirconn)
# Retrieving overall date, state, and counts dataframe
head(get_hist_total(seirconn))
# Retrieving date, state, and counts dataframe by variant
head(get_hist_virus(seirconn))
# Snapshot of totals at end of simulation
get_today_total(seirconn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.