Learn R Programming

EpiModel (version 1.8.0)

init_pids: Persistent ID Initialization

Description

This function initializes the persistent IDs for a networkDynamic object.

Usage

init_pids(nw, prefixes = c("F", "M"))

Arguments

nw

An object of class networkDynamic.

prefixes

Character string prefix for mode-specific ID.

Details

This function is used for netsim simulations over bipartite networks for populations with vital dynamics. Persistent IDs are required in this situation because when new nodes are added to the first mode in a bipartite network, the IDs for the second mode shift upward. Persistent IDs allow for an analysis of disease transmission chains for these simulations. These IDs are also invoked in the arrivals.net module when the persistent IDs of incoming nodes must be set.

See Also

initialize.pids

Examples

Run this code
# NOT RUN {
# Initialize network with 25 female and 75 male
nw <- network.initialize(100, bipartite = 25)

# Set persistent IDs using the default F/M prefix
nw <- init_pids(nw)
nw %v% "vertex.names"

# Use another prefix combination
nw <- init_pids(nw, c("A", "B"))
nw %v% "vertex.names"

# }

Run the code above in your browser using DataLab