These functions include ways to take a census of the positions of nodes in a network:

  • node_tie_census() returns a census of the ties in a network. For directed networks, out-ties and in-ties are bound together. for multiplex networks, the various types of ties are bound together.

  • node_triad_census() returns a census of the triad configurations nodes are embedded in.

  • node_quad_census() returns a census of nodes' positions in motifs of four nodes.

  • node_path_census() returns the shortest path lengths of each node to every other node in the network.

node_tie_census(.data)

node_triad_census(.data)

node_quad_census(.data)

node_path_census(.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

Quad census

The quad census uses the {oaqc} package to do the heavy lifting of counting the number of each orbits. See vignette('oaqc'). However, our function relabels some of the motifs to avoid conflicts and improve some consistency with other census-labelling practices. The letter-number pairing of these labels indicate the number and configuration of ties. For now, we offer a rough translation:

migraphOrtmann and Brandes
E4co-K4
I40, I41co-diamond
H4co-C4
L42, L41, L40co-paw
D42, D40co-claw
U42, U41P4
Y43, Y41claw
P43, P42, P41paw
04C4
Z42, Z43diamond
X4K4

See also this list of graph classes.

References

Davis, James A., and Samuel Leinhardt. 1967. “The Structure of Positive Interpersonal Relations in Small Groups.” 55.

Ortmann, Mark, and Ulrik Brandes. 2017. “Efficient Orbit-Aware Triad and Quad Census in Directed and Undirected Graphs.” Applied Network Science 2(1):13. doi:10.1007/s41109-017-0027-2 .

Dijkstra, Edsger W. 1959. "A note on two problems in connexion with graphs". Numerische Mathematik 1, 269-71. doi:10.1007/BF01386390 .

Opsahl, Tore, Filip Agneessens, and John Skvoretz. 2010. "Node centrality in weighted networks: Generalizing degree and shortest paths". Social Networks 32(3): 245-51. doi:10.1016/j.socnet.2010.03.006 .

See also

Examples

task_eg <- manynet::to_named(manynet::to_uniplex(manynet::ison_algebra, "tasks"))
(tie_cen <- node_tie_census(task_eg))
#> # A tibble: 16 × 33
#>    names    fromValeria fromWalter fromElaine fromClarence fromAllan fromDustin
#>    <chr>          <dbl>      <dbl>      <dbl>        <dbl>     <dbl>      <dbl>
#>  1 Valeria         0          0          0            0         0.3        0   
#>  2 Walter          0          0          0            0         0          0   
#>  3 Elaine          0          0          0            0         0.15       0.75
#>  4 Clarence        0          0          0            0         0          0   
#>  5 Allan           0.3        0          0.15         0         0          0.45
#>  6 Dustin          0          0          0.6          0         0.75       0   
#>  7 Eliana          0          0.75       0            0         0          0   
#>  8 Charlene        0          0.3        0            0         0          0   
#>  9 Philip          0.3        0          0            0         0          0   
#> 10 Isabelle        0.3        0          0            0.15      0          0.15
#> 11 Franklin        0          0          0.3          0         2.1        0.3 
#> 12 Elsie           0.15       0          0            0         0          0   
#> 13 Breanna         0          0.9        0            0         0.15       0   
#> 14 Clinton         0          0.15       0            0         0          0   
#> 15 Luis            0.15       0.15       0            0         0          0   
#> 16 Opal            5.1        4.8        0.3          0.9       1.8        0.9 
#> # ℹ 26 more variables: fromEliana <dbl>, fromCharlene <dbl>, fromPhilip <dbl>,
#> #   fromIsabelle <dbl>, fromFranklin <dbl>, fromElsie <dbl>, fromBreanna <dbl>,
#> #   fromClinton <dbl>, fromLuis <dbl>, fromOpal <dbl>, toValeria <dbl>,
#> #   toWalter <dbl>, toElaine <dbl>, toClarence <dbl>, toAllan <dbl>,
#> #   toDustin <dbl>, toEliana <dbl>, toCharlene <dbl>, toPhilip <dbl>,
#> #   toIsabelle <dbl>, toFranklin <dbl>, toElsie <dbl>, toBreanna <dbl>,
#> #   toClinton <dbl>, toLuis <dbl>, toOpal <dbl>
(triad_cen <- node_triad_census(task_eg))
#> # A tibble: 16 × 17
#>    names  X003  X012  X102 X021D X021U X021C X111D X111U X030T X030C  X201 X120D
#>    <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1 Vale…    23    11    39     0     0     0     2     2     0     0    17     0
#>  2 Walt…    21     6    47     0     0     0     5     6     0     0    10     0
#>  3 Elai…    34     3    46     0     0     0     2     1     0     0    13     0
#>  4 Clar…    52     6    28     0     0     0     0     0     0     0    18     0
#>  5 Allan    17    11    37     1     0     1     6     7     0     0    15     1
#>  6 Dust…    23     8    40     1     0     0     3     3     0     0    18     1
#>  7 Elia…    26     9    46     2     0     0     2     1     0     0    10     0
#>  8 Char…    26     1    54     0     0     0     1     3     0     0    11     0
#>  9 Phil…    27     4    50     0     0     0     1     0     0     0    13     0
#> 10 Isab…    14     3    53     0     0     0     2     0     0     0    21     0
#> 11 Fran…    34     3    46     0     0     0     2     1     0     0    13     0
#> 12 Elsie    27    13    41     0     0     0     1     1     0     0    12     0
#> 13 Brea…    29     7    40     0     0     1     4     5     0     0    12     0
#> 14 Clin…    24    20    26     2     0     1     7     5     0     0    11     1
#> 15 Luis     22     9    43     0     0     0     4     4     0     0    12     0
#> 16 Opal      0     0     0     0     0     0     0     0     0     0    73     0
#> # ℹ 4 more variables: X120U <dbl>, X120C <dbl>, X210 <dbl>, X300 <dbl>
node_quad_census(manynet::ison_southern_women)
#> # A tibble: 32 × 13
#>    names    E4   I41   I40    H4   L42   L41   L40   U42   U41   Y43   Y41   X04
#>    <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1 Evel…  1402  1046   474   202   397   692   148   200    78    56   190    75
#>  2 Laura  1539   986   579   202   323   659   182   134    85    35   168    68
#>  3 Ther…  1499   975   434   147   364   784    91   217    77    56   225    91
#>  4 Bren…  1559   968   562   198   320   682   179   134    82    35   170    71
#>  5 Char…  1945   763   972   171   117   419   359    30    89     4    70    21
#>  6 Fran…  2063   652   944   126   102   502   269    36   102     4   130    30
#>  7 Elea…  2122   598   930    98    93   546   224    42   114     4   156    33
#>  8 Pearl  2313   439  1089    65    42   448   252    28   112     1   154    17
#>  9 Ruth   2180   549   918    73    80   577   178    56   123     4   190    32
#> 10 Verne  2166   561   920    82    83   567   190    53   118     4   184    32
#> # ℹ 22 more rows
node_path_census(manynet::ison_adolescents)
#> # A tibble: 8 × 9
#>   names Betty   Sue Alice  Jane  Dale   Pam Carol  Tina
#>   <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 Betty     0     1     2     3     2     2     3     4
#> 2 Sue       1     0     1     2     1     1     2     3
#> 3 Alice     2     1     0     1     1     1     2     3
#> 4 Jane      3     2     1     0     1     2     3     4
#> 5 Dale      2     1     1     1     0     2     3     4
#> 6 Pam       2     1     1     2     2     0     1     2
#> 7 Carol     3     2     2     3     3     1     0     1
#> 8 Tina      4     3     3     4     4     2     1     0
node_path_census(manynet::ison_southern_women)
#> # A tibble: 32 × 33
#>    names Evelyn Laura Theresa Brenda Charlotte Frances Eleanor Pearl  Ruth Verne
#>    <chr>  <dbl> <dbl>   <dbl>  <dbl>     <dbl>   <dbl>   <dbl> <dbl> <dbl> <dbl>
#>  1 Evel…      0     2       2      2         2       2       2     2     2     2
#>  2 Laura      2     0       2      2         2       2       2     2     2     2
#>  3 Ther…      2     2       0      2         2       2       2     2     2     2
#>  4 Bren…      2     2       2      0         2       2       2     2     2     2
#>  5 Char…      2     2       2      2         0       2       2     4     2     2
#>  6 Fran…      2     2       2      2         2       0       2     2     2     2
#>  7 Elea…      2     2       2      2         2       2       0     2     2     2
#>  8 Pearl      2     2       2      2         4       2       2     0     2     2
#>  9 Ruth       2     2       2      2         2       2       2     2     0     2
#> 10 Verne      2     2       2      2         2       2       2     2     2     0
#> # ℹ 22 more rows
#> # ℹ 22 more variables: Myra <dbl>, Katherine <dbl>, Sylvia <dbl>, Nora <dbl>,
#> #   Helen <dbl>, Dorothy <dbl>, Olivia <dbl>, Flora <dbl>, E1 <dbl>, E2 <dbl>,
#> #   E3 <dbl>, E4 <dbl>, E5 <dbl>, E6 <dbl>, E7 <dbl>, E8 <dbl>, E9 <dbl>,
#> #   E10 <dbl>, E11 <dbl>, E12 <dbl>, E13 <dbl>, E14 <dbl>