Learn R Programming

EpiILM (version 1.5.2)

plot.epidata: S3 method to provide some graphics of epidemic.

Description

Produces various graphs summarizing epidemic of class epidata.

Usage

# S3 method for epidata
plot(x, plottype, curvetype = NULL, time_id = NULL, tmin = NULL, timepoints = NULL, ...)

Arguments

x

An object of class epidata that can be the output of epidata or as.epidata

plottype

Provide two types of plots. When plottype = "curve", graphs of various epidemic curves can be produced, and when plottype = "spatial", spatial plots of epidemic progression over time is produced.

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

...

........

Value

plot

Details

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.

See Also

epidata, plot.epimcmc, plot.pred.epi.

Examples

Run this code
# NOT RUN {

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

# }

Run the code above in your browser using DataLab