idgroup: Group Numbers for Two-Group Network

View source: R/net.utils.R

idgroupR Documentation

Group Numbers for Two-Group Network

Description

Outputs group numbers given ID numbers for a two-group network.

Usage

idgroup(nw, ids)

Arguments

nw

Object of class network or networkDynamic.

ids

Vector of ID numbers for which the group number should be returned.

Value

A vector containing the group number for each of the specified nodes.

Examples

nw <- network_initialize(n = 10)
nw <- set_vertex_attribute(nw, "group", rep(1:2, each = 5))
idgroup(nw)
idgroup(nw, ids = c(3, 6))


EpiModel documentation built on Oct. 12, 2024, 1:06 a.m.