ndtv
AnimationsCreates a new color-named temporally-extended attribute (TEA)
variable in a networkDynamic
object containing a disease
status TEA in numeric format.
color_tea(
nd,
old.var = "testatus",
old.sus = "s",
old.inf = "i",
old.rec = "r",
new.var = "ndtvcol",
new.sus,
new.inf,
new.rec,
verbose = TRUE
)
The updated object of class networkDynamic
.
An object of class networkDynamic
.
Old TEA variable name.
Status value for susceptible in old TEA variable.
Status value for infected in old TEA variable.
Status value for recovered in old TEA variable.
New TEA variable name to be stored in networkDynamic
object.
Status value for susceptible in new TEA variable.
Status value for infected in new TEA variable.
Status value for recovered in new TEA variable.
If TRUE
, print progress to console.
The ndtv
package (https://cran.r-project.org/package=ndtv)
produces animated visuals for dynamic networks with evolving edge structures
and nodal attributes. Nodal attribute dynamics in ndtv
movies require
a temporally extended attribute (TEA) containing a standard R color for each
node at each time step. By default, the EpiModel
package uses TEAs to
store disease status history in network model simulations run in
netsim
. But that status TEA is in numeric format (0, 1, 2).
The color_tea
function transforms those numeric values of that disease
status TEA into a TEA with color values in order to visualize status changes
in ndtv
.
The convention in plot.netsim
is to color the susceptible
nodes as blue, infected nodes as red, and recovered nodes as green. Alternate
colors may be specified using the new.sus
, new.inf
, and
new.rec
parameters, respectively.
Using the color_tea
function with a netsim
object requires that
TEAs for disease status be used and that the networkDynamic
object be
saved in the output: tergmListe
must be set to FALSE
in
control.net
.
netsim
and the ndtv
package documentation.