View source: R/centrality_measures.R
| net_edge_betweenness | R Documentation |
Builds a network in which each edge's weight is replaced by its
betweenness: the number of shortest paths between all node pairs that
traverse that edge (fractional when shortest paths tie). This is the
Nestimate counterpart of tna::betweenness_network() and produces
identical values for transition networks; the name differs to avoid a
clash with tna::betweenness_network() and
igraph::edge_betweenness().
net_edge_betweenness(x, invert = TRUE, ...)
## S3 method for class 'netobject'
net_edge_betweenness(x, invert = TRUE, ...)
## S3 method for class 'netobject_group'
net_edge_betweenness(x, invert = TRUE, ...)
## Default S3 method:
net_edge_betweenness(x, invert = TRUE, ...)
x |
A |
invert |
Logical. Invert weights to distances by |
... |
Additional arguments (ignored). |
For a probability/transition network the edge weights are transition
probabilities, so they are inverted to distances (invert = TRUE)
before path-finding: the geodesic between two states is then the most
probable route rather than the one with the fewest hops. Pass
invert = FALSE when the weights already represent distances.
Directedness is taken from the network itself. A directed network yields an asymmetric betweenness matrix; an undirected (symmetric) network yields a symmetric one.
For a netobject: a new netobject (class
c("netobject", "cograph_network")) whose $weights are the
edge-betweenness scores, with method = "edge_betweenness". Call
extract_edges() on it for a tidy per-edge table, or plot()
to render it. The object preserves source-network metadata so
permutation can test edge-betweenness differences by
permuting the source networks. For a netobject_group: a
netobject_group of such networks, one per group.
seqs <- data.frame(
V1 = c("A","B","A","C"), V2 = c("B","C","B","A"),
V3 = c("C","A","C","B"))
net <- build_network(seqs, method = "relative")
eb <- net_edge_betweenness(net)
extract_edges(eb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.