as.epidata: Discrete Time level information of an Epidemic

Description Usage Arguments Value See Also Examples

View source: R/as.epidata.r

Description

This function allows the user to generate objects of class "epidata". The output of this function provides information required to be used in the other functions in the package.

Usage

1
as.epidata (type, n, x = NULL, y = NULL, inftime, infperiod = NULL, contact = NULL)

Arguments

type

Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed.

n

Population size

x

X coordinates of individuals.

y

Y coordinates of individuals.

inftime

Times at which individuals are infected to initialize epidemic simulation.

infperiod

Length of infectious period for each individual.

contact

A contact network matrix or an array of contact network matrices.

Value

An object of class epidata is returned containing the following:

type

Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed.

XYcoordinates

The XY-coordinates of individuals if distance-based ILM is used, otherwise is NULL.

contact

Contact network matrix if network-based ILM is used, otherwise is NULL.

inftime

The infection times of individuals.

remtime

The removal times of individuals when type = “SIR”.

See Also

epidata, plot.epidata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# generate 100 X-Y coordinates for a distance-based ILM

x <- runif(100, 0, 10)

y <- runif(100, 0, 10)

# suppose we know the infection times for a spatial SI model based on above X-Y coordinates

inftime  <- rpois(100, 8) 

# Now we can convert above information to an epidata object with

out <- as.epidata(type = "SI", n = 100, x = x, y = y, inftime = inftime ) 
out

EpiILM documentation built on Jan. 13, 2021, 1:07 p.m.