| epiworld-gentime | R Documentation |
Extraction and plotting of generation time by virus over time.
get_generation_time(x)
## S3 method for class 'epiworld_generation_time'
plot(
x,
type = "b",
xlab = "Day (step)",
ylab = "Avg. Generation Time",
main = "Generation Time",
plot = TRUE,
...
)
plot_generation_time(x, ...)
x |
An object of class |
ylab, xlab, main, type |
Further parameters passed to |
plot |
Logical scalar. If |
... |
In the case of plot methods, further arguments passed to graphics::plot. |
The function get_generation_time returns a data.frame with
the following columns: "agent", "virus_id", "virus", "date", and "gentime".
The function plot_generation_time is a wrapper for plot and
get_generation_time.
Other Epidemiological metrics:
epiworld-repnum
# 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
)
set.seed(937)
run(seirconn, 50)
# Get and plot generation time
gent <- plot_generation_time(seirconn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.