Plot_epidemic: Plot a spatial epidemic.

Description Usage Arguments Value Examples

View source: R/Plot_epidemic.R

Description

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

Usage

1
Plot_epidemic(xy.coords, sim, init.inf = 1)

Arguments

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.

Value

A spatial plot of the epidemic

Examples

 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))

BenjamenSimon/EpidemicR documentation built on March 23, 2020, 11:03 p.m.