These functions create a vector of nodes' memberships in components:
node_in_component() assigns nodes' component membership,
in either the strongly or the weakly connected components.
In graph theory, components, sometimes called connected components, are induced subgraphs from partitioning the nodes into disjoint sets. All nodes that are members of the same partition as i are reachable from i.
For directed networks, strongly connected components consist of subgraphs where there are paths in each direction between member nodes. Weakly connected components consist of subgraphs where there is a path in either direction between member nodes.
node_in_component(.data, connectivity = c("strong", "weak"))A network object of class stocnet, igraph, tbl_graph, network, or similar.
Internally any of these will be coerced to an efficient implementation.
For more information on possible coercions, see e.g. manynet::as_stocnet().
Character string, "weak" treats a directed network's components as if the network were undirected, and "strong" requires ties in both directions between members. This is ignored for undirected networks, where the two notions coincide. Note that the default differs by function: functions that assert or count connectedness default to "strong", while functions that scope or split a network into components default to "weak".
A node_member character vector the length of the nodes in the network,
of group memberships "A", "B", etc for each node.
If the network is labelled,
then the assignments will be labelled with the nodes' names.
Other memberships:
member_brokerage,
member_cliques,
member_community,
member_community_hier,
member_community_non,
member_core,
member_diffusion,
member_equivalence
Other nodal:
mark_core,
mark_degree,
mark_diff,
mark_nodes,
mark_select_node,
measure_assort_node,
measure_broker_node,
measure_brokerage,
measure_central_between,
measure_central_close,
measure_central_degree,
measure_central_eigen,
measure_closure_node,
measure_core,
measure_diffusion_node,
measure_diverse_node,
member_brokerage,
member_cliques,
member_community,
member_community_hier,
member_community_non,
member_core,
member_diffusion,
member_equivalence,
motif_brokerage_node,
motif_clique,
motif_composition,
motif_exposure,
motif_node,
motif_path
ison_monks |> to_uniplex("esteem") |>
mutate_nodes(comp = node_in_component())
#>
#> ── # Sampson's Monks ───────────────────────────────────────────────────────────
#> # A longitudinal, labelled, signed, weighted, directed network of 18 nodes and
#> 112 esteem arcs over 1 waves
#> # Transformed by exclusion: layers other than 'esteem' (351 ties excluded)
#>
#> ── Nodes
#> # A tibble: 18 × 4
#> label groups left comp
#> <chr> <chr> <dbl> <nod_mmbr>
#> 1 Romuald Interstitial 3 B
#> 2 Bonaventure Loyal 4 A
#> 3 Ambrose Loyal 4 A
#> 4 Berthold Loyal 4 A
#> 5 Peter Loyal 3 A
#> 6 Louis Loyal 4 A
#> # ℹ 12 more rows
#>
#> ── Ties
#> # A tibble: 112 × 4
#> from to weight time
#> <int> <int> <dbl> <dbl>
#> 1 2 3 1 1
#> 2 2 5 3 1
#> 3 2 6 2 1
#> 4 2 16 -1 1
#> 5 2 17 -3 1
#> 6 2 18 -2 1
#> # ℹ 106 more rows
#>
ison_monks |> to_uniplex("esteem") |>
mutate_nodes(comp = node_in_component(connectivity = "weak"))
#>
#> ── # Sampson's Monks ───────────────────────────────────────────────────────────
#> # A longitudinal, labelled, signed, weighted, directed network of 18 nodes and
#> 112 esteem arcs over 1 waves
#> # Transformed by exclusion: layers other than 'esteem' (351 ties excluded)
#>
#> ── Nodes
#> # A tibble: 18 × 4
#> label groups left comp
#> <chr> <chr> <dbl> <nod_mmbr>
#> 1 Romuald Interstitial 3 A
#> 2 Bonaventure Loyal 4 A
#> 3 Ambrose Loyal 4 A
#> 4 Berthold Loyal 4 A
#> 5 Peter Loyal 3 A
#> 6 Louis Loyal 4 A
#> # ℹ 12 more rows
#>
#> ── Ties
#> # A tibble: 112 × 4
#> from to weight time
#> <int> <int> <dbl> <dbl>
#> 1 2 3 1 1
#> 2 2 5 3 1
#> 3 2 6 2 1
#> 4 2 16 -1 1
#> 5 2 17 -3 1
#> 6 2 18 -2 1
#> # ℹ 106 more rows
#>