These functions calculate common centrality measures for one- and two-mode networks.
All measures attempt to use as much information as they are offered,
including whether the networks are directed, weighted, or multimodal.
If this would produce unintended results,
first transform the salient properties using e.g. to_undirected()
functions.
All centrality and centralization measures return normalized measures by default,
including for two-mode networks.
node_degree(object, normalized = TRUE, direction = c("all", "out", "in"))
tie_degree(object, normalized = TRUE)
node_closeness(object, normalized = TRUE, direction = "out", cutoff = NULL)
tie_closeness(object, normalized = TRUE)
node_betweenness(object, normalized = TRUE, cutoff = NULL)
tie_betweenness(object, normalized = TRUE)
node_eigenvector(object, normalized = TRUE, scale = FALSE)
tie_eigenvector(object, normalized = TRUE)
node_reach(object, normalized = TRUE, k = 2)
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
Logical scalar, whether the centrality scores are normalized. Different denominators are used depending on whether the object is one-mode or two-mode, the type of centrality, and other arguments.
Character string, “out” bases the measure on outgoing ties, “in” on incoming ties, and "all" on either/the sum of the two. For two-mode networks, "all" uses as numerator the sum of differences between the maximum centrality score for the mode against all other centrality scores in the network, whereas "in" uses as numerator the sum of differences between the maximum centrality score for the mode against only the centrality scores of the other nodes in that mode.
Maximum path length to use during calculations.
Logical scalar, whether to rescale the vector so the maximum score is 1.
Integer of steps out to calculate reach
A single centralization score if the object was one-mode, and two centralization scores if the object was two-mode.
Depending on how and what kind of an object is passed to the function,
the function will return a tidygraph
object where the nodes have been updated
A numeric vector giving the betweenness centrality measure of each node.
A numeric vector giving the eigenvector centrality measure of each node.
node_degree
: Calculates the degree centrality of nodes in an unweighted network,
or weighted degree/strength of nodes in a weighted network.
tie_degree
: Calculate the degree centrality of edges in a network
node_closeness
: Calculate the closeness centrality of nodes in a network
tie_closeness
: Calculate the closeness of each edge to each other edge
in the network.
node_betweenness
: Calculate the betweenness centralities of nodes in a network
tie_betweenness
: Calculate number of shortest paths going through an edge
node_eigenvector
: Calculate the eigenvector centrality of nodes in a network
tie_eigenvector
: Calculate the eigenvector centrality of edges in a network
node_reach
: Calculate nodes' reach centrality
Faust, Katherine. 1997. "Centrality in affiliation networks." Social Networks 19(2): 157-191. doi:10.1016/S0378-8733(96)00300-0 .
Borgatti, Stephen P., and Martin G. Everett. 1997. "Network analysis of 2-mode data." Social Networks 19(3): 243-270. doi:10.1016/S0378-8733(96)00301-2 .
Borgatti, Stephen P., and Daniel S. Halgin. 2011. "Analyzing affiliation networks." In The SAGE Handbook of Social Network Analysis, edited by John Scott and Peter J. Carrington, 417–33. London, UK: Sage. doi:10.4135/9781446294413.n28 .
Bonacich, Phillip. 1991. “Simultaneous Group and Individual Centralities.” Social Networks 13(2):155–68. doi:10.1016/0378-8733(91)90018-O .
to_undirected()
for removing edge directions
and to_unweighted()
for removing weights from a graph.
Other measures:
centralisation
,
closure
,
cohesion()
,
diversity
,
features
,
holes
node_degree(mpn_elite_mex)
#> Trevino Madero Carranza Aguilar Obregon Calles `Aleman Gonzalez` `Portes Gil`
#> 1 0.0882 0.176 0.235 0.176 0.176 0.176 0.147 0.235
#> # ... with 27 more in the vector.
node_degree(ison_southern_women)
#> EVELYN LAURA THERESA BRENDA CHARLOTTE FRANCES ELEANOR PEARL RUTH VERNE MYRA
#> 1 0.571 0.5 0.571 0.5 0.286 0.286 0.286 0.214 0.286 0.286 0.286
#> # ... with 7 more in the vector.
#> E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 E11 E12 E13
#> 1 0.167 0.167 0.333 0.222 0.444 0.444 0.556 0.778 0.667 0.333 0.222 0.389 0.222
#> # ... with 1 more in the vector.
tie_degree(ison_adolescents)
#> `Betty-Sue` `Sue-Alice` `Alice-Jane` `Sue-Dale` `Alice-Dale` `Jane-Dale`
#> 1 0.333 0.667 0.444 0.556 0.556 0.333
#> # ... with 4 more in the vector.
node_closeness(mpn_elite_mex)
#> Trevino Madero Carranza Aguilar Obregon Calles `Aleman Gonzalez` `Portes Gil`
#> 1 0.4 0.405 0.466 0.493 0.436 0.459 0.466 0.493
#> # ... with 27 more in the vector.
node_closeness(ison_southern_women)
#> EVELYN LAURA THERESA BRENDA CHARLOTTE FRANCES ELEANOR PEARL RUTH VERNE MYRA
#> 1 0.8 0.727 0.8 0.727 0.6 0.667 0.667 0.667 0.706 0.706 0.686
#> # ... with 7 more in the vector.
#> E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 E11 E12 E13
#> 1 0.524 0.524 0.564 0.537 0.595 0.688 0.733 0.846 0.786 0.564 0.537 0.579 0.537
#> # ... with 1 more in the vector.
(ec <- tie_closeness(ison_adolescents))
#> `Betty-Sue` `Sue-Alice` `Alice-Jane` `Sue-Dale` `Alice-Dale` `Jane-Dale`
#> 1 0.562 0.692 0.6 0.643 0.643 0.5
#> # ... with 4 more in the vector.
plot(ec)
ison_adolescents %>%
activate(edges) %>% mutate(weight = ec) %>%
autographr()
node_betweenness(mpn_elite_mex)
#> Trevino Madero Carranza Aguilar Obregon Calles `Aleman Gonzalez` `Portes Gil`
#> 1 0.00505 0.00819 0.0309 0.0206 0.00806 0.0249 0.00944 0.0389
#> # ... with 27 more in the vector.
node_betweenness(ison_southern_women)
#> V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11
#> 1 0.0967 0.0517 0.0876 0.0498 0.0107 0.0108 0.00936 0.00673 0.0167 0.0144 0.0134
#> # ... with 7 more in the vector.
#> V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11
#> 1 0.00215 0.00209 0.0181 0.00764 0.0376 0.0620 0.129 0.240 0.213 0.0151 0.0200
#> # ... with 3 more in the vector.
(tb <- tie_betweenness(ison_adolescents))
#> `Betty-Sue` `Sue-Alice` `Alice-Jane` `Sue-Dale` `Alice-Dale` `Jane-Dale`
#> 1 7 3 5 4.5 2.5 2
#> # ... with 4 more in the vector.
plot(tb)
ison_adolescents %>%
activate(edges) %>% mutate(weight = tb) %>%
autographr()
node_eigenvector(mpn_elite_mex)
#> Trevino Madero Carranza Aguilar Obregon Calles `Aleman Gonzalez` `Portes Gil`
#> 1 0.0808 0.109 0.166 0.170 0.130 0.138 0.140 0.208
#> # ... with 27 more in the vector.
node_eigenvector(ison_southern_women)
#> EVELYN LAURA THERESA BRENDA CHARLOTTE FRANCES ELEANOR PEARL RUTH VERNE MYRA
#> 1 0.423 0.397 0.472 0.402 0.227 0.287 0.319 0.264 0.337 0.327 0.292
#> # ... with 7 more in the vector.
#> E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 E11 E12 E13
#> 1 0.215 0.228 0.356 0.261 0.431 0.447 0.522 0.639 0.505 0.323 0.159 0.361 0.251
#> # ... with 1 more in the vector.
tie_eigenvector(ison_adolescents)
#> `Betty-Sue` `Sue-Alice` `Alice-Jane` `Sue-Dale` `Alice-Dale` `Jane-Dale`
#> 1 0.366 0.638 0.447 0.524 0.541 0.333
#> # ... with 4 more in the vector.
node_reach(ison_adolescents)
#> Betty Sue Alice Jane Dale Pam Carol Tina
#> 1 0.429 0.286 0.286 0.286 0.286 0.571 0.286 0.143