These functions include ways to take a census of the positions of nodes in a network. These include a triad census based on the triad profile of nodes, but also a tie census based on the particular tie partners of nodes. Included also are group census functions for summarising the profiles of clusters of nodes in a network.
node_tie_census(object)
node_triad_census(object)
node_quad_census(object)
node_path_census(object)
An object of a migraph-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
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:
migraph | Ortmann and Brandes |
E4 | co-K4 |
I40, I41 | co-diamond |
H4 | co-C4 |
L42, L41, L40 | co-paw |
D42, D40 | co-claw |
U42, U41 | P4 |
Y43, Y41 | claw |
P43, P42, P41 | paw |
04 | C4 |
Z42, Z43 | diamond |
X4 | K4 |
node_tie_census
: Returns a census of the ties in a network.
For directed networks, out-ties and in-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.
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 .
Other motifs:
graph_census
task_eg <- to_named(to_uniplex(ison_algebra, "task_tie"))
(tie_cen <- node_tie_census(task_eg))
#> # A tibble: 16 × 32
#> fromWillis fromMandy fromBraxton fromGina fromAbby fromMabel fromClayton
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 1 0 0 1 1 0
#> 2 0 0 1 0 0 0 1
#> 3 0 1 0 0 1 1 1
#> 4 0 0 0 0 0 0 0
#> 5 1 0 1 0 0 1 0
#> 6 0 0 1 0 1 0 0
#> 7 0 1 1 0 0 1 0
#> 8 1 1 1 0 1 1 1
#> 9 1 0 0 0 0 0 0
#> 10 1 0 1 1 1 1 0
#> 11 1 0 1 0 1 1 0
#> 12 1 1 0 0 0 1 0
#> 13 1 1 0 0 1 0 1
#> 14 0 1 1 0 0 1 1
#> 15 1 1 1 0 1 0 1
#> 16 1 1 1 1 1 1 1
#> # … with 25 more variables: fromBecky <dbl>, fromRachel <dbl>,
#> # fromMeredith <dbl>, fromAriel <dbl>, fromDestiny <dbl>, fromPaulette <dbl>,
#> # fromPaula <dbl>, fromRiley <dbl>, fromNolan <dbl>, toWillis <dbl>,
#> # toMandy <dbl>, toBraxton <dbl>, toGina <dbl>, toAbby <dbl>, toMabel <dbl>,
#> # toClayton <dbl>, toBecky <dbl>, toRachel <dbl>, toMeredith <dbl>,
#> # toAriel <dbl>, toDestiny <dbl>, toPaulette <dbl>, toPaula <dbl>,
#> # toRiley <dbl>, toNolan <dbl>
(triad_cen <- node_triad_census(task_eg))
#> # A tibble: 16 × 16
#> `003` `012` `102` `021D` `021U` `021C` `111D` `111U` `030T` `030C` `201`
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 6 12 32 0 1 0 7 3 0 0 8
#> 2 15 12 42 0 0 0 0 5 0 0 4
#> 3 20 5 37 0 0 0 3 3 0 0 12
#> 4 102 0 3 0 0 0 0 0 0 0 0
#> 5 15 5 41 0 0 0 2 1 0 0 13
#> 6 20 5 41 0 0 0 3 2 0 0 11
#> 7 28 0 51 0 0 0 0 2 0 0 6
#> 8 18 0 42 0 0 0 2 1 0 0 18
#> 9 86 2 17 0 0 0 0 0 0 0 0
#> 10 25 6 35 0 0 0 3 3 0 0 15
#> 11 65 4 36 0 0 0 0 0 0 0 0
#> 12 72 3 30 0 0 0 0 0 0 0 0
#> 13 76 3 26 0 0 0 0 0 0 0 0
#> 14 56 2 47 0 0 0 0 0 0 0 0
#> 15 58 5 42 0 0 0 0 0 0 0 0
#> 16 0 0 0 0 0 0 0 0 0 0 44
#> # … with 5 more variables: `120D` <dbl>, `120U` <dbl>, `120C` <dbl>,
#> # `210` <dbl>, `300` <dbl>
node_path_census(ison_adolescents)
#> # A tibble: 8 × 8
#> Betty Sue Alice Jane Dale Pam Carol Tina
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 1 2 3 2 2 3 4
#> 2 1 0 1 2 1 1 2 3
#> 3 2 1 0 1 1 1 2 3
#> 4 3 2 1 0 1 2 3 4
#> 5 2 1 1 1 0 2 3 4
#> 6 2 1 1 2 2 0 1 2
#> 7 3 2 2 3 3 1 0 1
#> 8 4 3 3 4 4 2 1 0
node_path_census(ison_southern_women)
#> # A tibble: 32 × 18
#> EVELYN LAURA THERESA BRENDA CHARLOTTE FRANCES ELEANOR PEARL RUTH VERNE MYRA
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 2 2 2 2 2 2 2 2 2 2
#> 2 2 0 2 2 2 2 2 2 2 2 2
#> 3 2 2 0 2 2 2 2 2 2 2 2
#> 4 2 2 2 0 2 2 2 2 2 2 2
#> 5 2 2 2 2 0 2 2 4 2 2 4
#> 6 2 2 2 2 2 0 2 2 2 2 2
#> 7 2 2 2 2 2 2 0 2 2 2 2
#> 8 2 2 2 2 4 2 2 0 2 2 2
#> 9 2 2 2 2 2 2 2 2 0 2 2
#> 10 2 2 2 2 2 2 2 2 2 0 2
#> # … with 22 more rows, and 7 more variables: KATHERINE <dbl>, SYLVIA <dbl>,
#> # NORA <dbl>, HELEN <dbl>, DOROTHY <dbl>, OLIVIA <dbl>, FLORA <dbl>
#> # A tibble: 32 × 14
#> E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 E11 E12 E13
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1 1 1 1 1 3 1 1 3 3 3 3
#> 2 1 1 1 3 1 1 1 1 3 3 3 3 3
#> 3 3 1 1 1 1 1 1 1 1 3 3 3 3
#> 4 1 3 1 1 1 1 1 1 3 3 3 3 3
#> 5 3 3 1 1 1 3 1 3 3 3 3 3 3
#> 6 3 3 1 3 1 1 3 1 3 3 3 3 3
#> 7 3 3 3 3 1 1 1 1 3 3 3 3 3
#> 8 3 3 3 3 3 1 3 1 1 3 3 3 3
#> 9 3 3 3 3 1 3 1 1 1 3 3 3 3
#> 10 3 3 3 3 3 3 1 1 1 3 3 1 3
#> # … with 22 more rows, and 1 more variable: E14 <dbl>