Outputs group numbers given ID numbers for a two-group network.
Examples
nw <- network_initialize(n = 10)
nw <- set_vertex_attribute(nw, "group", rep(1:2, each = 5))
idgroup(nw)
#> [1] 1 1 1 1 1 2 2 2 2 2
idgroup(nw, ids = c(3, 6))
#> [1] 1 2
Outputs group numbers given ID numbers for a two-group network.
nw <- network_initialize(n = 10)
nw <- set_vertex_attribute(nw, "group", rep(1:2, each = 5))
idgroup(nw)
#> [1] 1 1 1 1 1 2 2 2 2 2
idgroup(nw, ids = c(3, 6))
#> [1] 1 2