These functions create a vector of nodes' memberships in components:

  • node_in_component() assigns nodes' component membership using edge direction where available.

  • node_in_weak() assigns nodes' component membership ignoring edge direction.

  • node_in_strong() assigns nodes' component membership based on edge direction.

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)

node_in_weak(.data)

node_in_strong(.data)

Arguments

.data

An object of a manynet-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

Examples

ison_monks %>% to_uniplex("esteem") %>%
  mutate_nodes(comp = node_in_component())
#> 
#> ── # Sampson's Monks ───────────────────────────────────────────────────────────
#> # A labelled, signed, weighted, directed network of 18 nodes and 112 arcs
#> 
#> ── Nodes 
#> # A tibble: 18 × 4
#>   name        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  sign weight
#>   <int> <int> <dbl>  <dbl>
#> 1     2     3     1      1
#> 2     2     5     1      3
#> 3     2     6     1      2
#> 4     2    16    -1      1
#> 5     2    17    -1      3
#> 6     2    18    -1      2
#> # ℹ 106 more rows
#>