Description Usage Arguments Value Examples
View source: R/Plot_epidemic.R
This function takes in an epidemic simulation generated by this package and outputs a colour coded plot. The circles are the remaining susceptibles, the red crosses are the infected individuals, and the blue crossed boxes are the initial infectives
1 | Plot_epidemic(xy.coords, sim, init.inf = 1)
|
xy.coords |
The coordinates of all individuals in the population |
sim |
The output of the epidemic simulation |
init.inf |
A vector of the ID(s) of the initial invective(s). This just defaults to 1 as in the simulation. |
A spatial plot of the epidemic
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Generate a distance matrix
C <- Dist_mat_unif(N=100, xlim = 20, ylim = 20)
xy.coords <- C[[1]]
distance_mat <- C[[2]]
# Generate an associated infection rate rate matrix
rate_mat <- Beta_mat_form(distance_mat, c(0.004, 0.002), 10)
# Generate a simulated epidemic
Hetero_sim <- GSE_sim(N = 100, beta.mat = rate_mat, gamma = 0.15)
# Plot the epidemic
Plot_epidemic(xy.coords, Hetero_sim, init.inf = c(1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.