| as.epidata {EpiILM} | R Documentation |
Discrete Time level information of an Epidemic
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
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
Examples
# 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