plot_single_epidemic: Plot a single epidemic simulation

View source: R/plot_single_epidemic.R

plot_single_epidemicR Documentation

Plot a single epidemic simulation

Description

This function creates two plots for a single epidemic simulation: one for new infections and one for reported cases.

Usage

plot_single_epidemic(epidemic, epidemic_num)

Arguments

epidemic

A list containing the results of a single epidemic simulation, typically an element from an "ssir_epidemic_multi" object.

epidemic_num

An integer indicating the epidemic number, used in the plot titles.

Value

A grid arrangement of two ggplot objects: new infections and reported cases.

Examples

# Assuming you have run a simulation:
result <- ssir(N = 10000, T = 300, alpha = 0.3, inf_period = 4, inf_init = 32,
report = 0.02, lag = 7)
plot_single_epidemic(result, 1)

# For multiple simulations:
multi_result <- ssir(N = 10000, T = 300, alpha = 0.3, inf_period = 4, inf_init = 32,
report = 0.02, lag = 7, rep = 5)
plot_single_epidemic(multi_result[[1]], 1)


DESA documentation built on June 8, 2025, 10:19 a.m.