Learn R Programming

EpiModel (version 0.95)

node.active: Query Active Nodes in NetworkDynamic Object

Description

This function outputs information on the active nodes in a networkDynamic object.

Usage

node.active(nw, at, out, mode, active.default = FALSE)

Arguments

nw
an object of class networkDynamic.
at
time step to query.
out
function output, with options of out="vec" for a T/F vector of whether the node is active, out="ids" for a vector of IDs active, out="prev" for the number of nodes that are active, and out="all"
mode
if nw is bipartite, the mode number for status (may be ignored if requesting output for both modes).
active.default
if TRUE, elements without an activity attribute will be regarded as active.

Details

This is a specialized version of is.active from the networkDynamic package that allows for key output to be efficiently generated for use in epiNet.simTrans simulations. For functions that query active nodes with specific values of the disease status TEA, use get.stat or get.prev.

See Also

is.active, get.stat, get.prev

Examples

Run this code
# Initialize NW and activate vertices
nw <- network.initialize(20)

# Activate all vertices, then deactive half at time 5
activate.vertices(nw, onset = 1, terminus = 10)
deactivate.vertices(nw, onset = 5, terminus = 10, v = 1:10)

# Output all information for vertices at time 1 and time 5
node.active(nw, at = 1, out = "all")
node.active(nw, at = 5, out = "all")

Run the code above in your browser using DataLab