These functions return values or vectors relating to how broad a network is.

  • net_by_diameter() measures the maximum path length in the network.

  • net_by_length() measures the average path length in the network.

net_by_diameter(.data)

net_by_length(.data)

Arguments

.data

A network object of class stocnet, igraph, tbl_graph, network, or similar. Internally any of these will be coerced to an efficient implementation. For more information on possible coercions, see e.g. manynet::as_stocnet().

Value

A network_measure numeric score.

The object also carries the measure it computed, the range its values can fall within, and whether and how those values were normalized. These are shown as a one-line header when the object is printed. Where a measure offers a choice between several ways of counting the same thing, it also carries the variant it used. All can be retrieved with attr().

Cognitive social structures

A cognitive social structure records each node's report of the ties in the whole network, in a by column that names who reported each tie. Counting every report as a tie of its own would count each tie once for every perceiver who reports it. So the functions here first combine the reports into the locally aggregated structure of Krackhardt (1987), with the intersection rule: a tie exists if both of its ends report it, and a message says so. A tie that names no reporter is kept as it is.

A tie-level function still returns one value for each report, so that the result can be added back to the network it was given. Each report takes the value of the tie that it reports. A report of a tie that is not in the aggregated structure takes NA, or FALSE for a mark. tie_is_random() is the exception, and draws among the reports.

To combine the reports in a different way, do this before the function, e.g. with manynet::to_aggregated(over = "by").

Krackhardt, David. 1987. "Cognitive social structures". Social Networks 9(2): 109-134. doi:10.1016/0378-8733(87)90009-8

Signed networks

Both measures count path lengths, and a negative tie is hostility rather than a channel along which cohesion travels. Where the network is signed, they therefore consider only the positive ties. Use manynet::to_unsigned() first to control this yourself.

Note that dropping the negative ties can disconnect the network, in which case the measure covers the reachable pairs only.

Examples

net_by_diameter(fict_marvel)
#> # Diameter [0, Inf)
#> [1] 5
net_by_diameter(to_giant(fict_marvel))
#> # Diameter [0, Inf)
#> [1] 5
net_by_length(fict_marvel)
#> # Average path length [0, Inf)
#> [1] 2.55
net_by_length(to_giant(fict_marvel))
#> # Average path length [0, Inf)
#> [1] 2.55