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     fromApril fromBrad fromCharlotte fromDrew fromEmily fromFannie
#>   <chr>         <dbl>    <dbl>         <dbl>    <dbl>     <dbl>      <dbl>
#> 1 April           0          0          0           0      0.3        0   
#> 2 Brad            0          0          0           0      0          0   
#> 3 Charlotte       0          0          0           0      0.15       0.75
#> 4 Drew            0          0          0           0      0          0   
#> 5 Emily           0.3        0          0.15        0      0          0.45
#> 6 Fannie          0          0          0.6         0      0.75       0   
#> # ℹ 10 more rows
#> # ℹ 26 more variables: fromGarrett <dbl>, fromHadley <dbl>, fromIsabelle <dbl>,
#> #   fromJayla <dbl>, fromKrista <dbl>, fromLinda <dbl>, fromMabel <dbl>,
#> #   fromNannie <dbl>, fromOmar <dbl>, fromPiper <dbl>, toApril <dbl>,
#> #   toBrad <dbl>, toCharlotte <dbl>, toDrew <dbl>, toEmily <dbl>,
#> #   toFannie <dbl>, toGarrett <dbl>, toHadley <dbl>, toIsabelle <dbl>,
#> #   toJayla <dbl>, toKrista <dbl>, toLinda <dbl>, toMabel <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>