Learn R Programming

EpiModel (version 0.95)

colorTEA: Creates a TEA Variable for Infection Status for ndtv Animations

Description

This function creates a new temporally-extended attribute (TEA) variable in a networkDynamic object with color name output from an existing status variable with numeric format.

Usage

colorTEA(nw, old.var = "status", old.sus = 0, old.inf = 1, old.rec = 2,
  new.var = "ndtvcol", new.sus, new.inf, new.rec, verbose = TRUE)

Arguments

nw
an object of class networkDynamic.
old.var
old TEA variable name.
old.sus
status value for susceptible in old TEA variable.
old.inf
status value for infected in old TEA variable.
old.rec
status value for recovered in old TEA variable.
new.var
new TEA variable name to be stored in nw object.
new.sus
status value for susceptible in new TEA variable.
new.inf
status value for infected in new TEA variable.
new.rec
status value for recovered in new TEA variable.
verbose
print progress for calculations.

Details

The ndtv package allows for animated plots of dynamic network objects, showing the evolving partnership structure. The EpiModel package uses temporally-extended attributes (TEAs) to store longitudinal disease status for every vertex in a dynamic network. To visualize disease status dynamically in ndtv, it is currently necessary to create a TEA containing the colors to be used in drawing the nodes.

The convention in plot.epiNet.simTrans is to color the susceptible nodes as blue, infected nodes as red, and recovered nodes as green. This function allows the user to take the existing status TEA on the networkDynamic object and transform that numeric variable into any colors.

See Also

epiNet.simTrans and the ndtv package documentation.

Examples

Run this code
## See EpiModel Tutorial vignette ##

Run the code above in your browser using DataLab