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

  • node_x_tie() 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_x_path() returns the shortest path lengths of each node to every other node in the network.

node_x_tie(.data)

node_x_path(.data)

Arguments

.data

A network object of class mnet, igraph, tbl_graph, network, or similar. For more information on the standard coercion possible, see manynet::as_tidygraph().

Value

A node_motif matrix with one row for each node in the network and a column for each motif type, giving the count of each motif in which each node participates. It is printed as a tibble, however, to avoid greedy printing. If the network is labelled, then the node names will be in a column named names.

References

On paths

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 .

Examples

task_eg <- to_named(to_uniplex(ison_algebra, "tasks"))
(tie_cen <- node_x_tie(task_eg))
#> # A tibble: 16 × 33
#>   names    fromAllen fromBeatrice fromCynthia fromDalton fromEliana fromFern
#>   <chr>        <dbl>        <dbl>       <dbl>      <dbl>      <dbl>    <dbl>
#> 1 Allen          0              0        0             0       0.3      0   
#> 2 Beatrice       0              0        0             0       0        0   
#> 3 Cynthia        0              0        0             0       0.15     0.75
#> 4 Dalton         0              0        0             0       0        0   
#> 5 Eliana         0.3            0        0.15          0       0        0.45
#> 6 Fern           0              0        0.6           0       0.75     0   
#> # ℹ 10 more rows
#> # ℹ 26 more variables: fromGraham <dbl>, fromHope <dbl>, fromIsabella <dbl>,
#> #   fromJerry <dbl>, fromKristopher <dbl>, fromLindsay <dbl>, fromMathew <dbl>,
#> #   fromNicolas <dbl>, fromOliver <dbl>, fromPatty <dbl>, toAllen <dbl>,
#> #   toBeatrice <dbl>, toCynthia <dbl>, toDalton <dbl>, toEliana <dbl>,
#> #   toFern <dbl>, toGraham <dbl>, toHope <dbl>, toIsabella <dbl>,
#> #   toJerry <dbl>, toKristopher <dbl>, toLindsay <dbl>, toMathew <dbl>, …
node_x_path(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
#> # ℹ 2 more rows
node_x_path(ison_southern_women)
#> # A tibble: 18 × 33
#>   names  Evelyn Laura Theresa Brenda Charlotte Frances Eleanor Pearl  Ruth Verne
#>   <chr>   <dbl> <dbl>   <dbl>  <dbl>     <dbl>   <dbl>   <dbl> <dbl> <dbl> <dbl>
#> 1 Evelyn      0     2       2      2         2       2       2     2     2     2
#> 2 Laura       2     0       2      2         2       2       2     2     2     2
#> 3 There…      2     2       0      2         2       2       2     2     2     2
#> 4 Brenda      2     2       2      0         2       2       2     2     2     2
#> 5 Charl…      2     2       2      2         0       2       2     4     2     2
#> 6 Franc…      2     2       2      2         2       0       2     2     2     2
#> # ℹ 12 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>
#> # A tibble: 14 × 33
#>   names Evelyn Laura Theresa Brenda Charlotte Frances Eleanor Pearl  Ruth Verne
#>   <chr>  <dbl> <dbl>   <dbl>  <dbl>     <dbl>   <dbl>   <dbl> <dbl> <dbl> <dbl>
#> 1 E1         1     1       3      1         3       3       3     3     3     3
#> 2 E2         1     1       1      3         3       3       3     3     3     3
#> 3 E3         1     1       1      1         1       1       3     3     3     3
#> 4 E4         1     3       1      1         1       3       3     3     3     3
#> 5 E5         1     1       1      1         1       1       1     3     1     3
#> 6 E6         1     1       1      1         3       1       1     1     3     3
#> # ℹ 8 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>