plot.epidata {EpiILM} | R Documentation |
Produces various graphs summarizing epidemic of class epidata
.
## S3 method for class 'epidata'
plot(x, plottype, curvetype = NULL, time_id = NULL, tmin = NULL, timepoints = NULL, ...)
x |
An object of class |
plottype |
Provide two types of plots. When |
curvetype |
It has four options: "complete", "susceptible", "newinfect", and "totalinfect". See details for more information. |
time_id |
Specify time points at which the spatial square is plotted. |
tmin |
Initial time point at which infection occurs, default value is one. |
timepoints |
Specify time points at which the curve is plotted |
... |
........ |
The argument plottype
has two options. When plottype
=“spatial” spatial plots are produced for the epidemic progression over time, and when plottype
=“curve”, the argument curvetype
has to be specified to one of the four available options: "complete" for plotting the number of susceptible, infected and removed individuals at each time point, "susceptible" for plotting the number of susceptible individuals at each time point, "newinfect" for plotting the number of newly infected individuals at each time point, and "totalinfect" for plotting the cumulative number of infected individuals at each time point.
plot
epidata
, plot.epimcmc
, plot.pred.epi
.
## Example : spatial SI model
# generate 100 individuals
x <- runif(100, 0, 10)
y <- runif(100, 0, 10)
covariate <- runif(100, 0, 2)
out1 <- epidata(type = "SI",n = 100, Sformula = ~covariate, tmax = 15,
sus.par = c(0.1, 0.3), beta = 5.0, x = x, y = y)
# Plots of epidemic progression
plot(out1, plottype = "spatial")
plot(out1, plottype = "curve", curvetype = "newinfect")