powered by
Inverse of the average shortest path distance from a node to all others. For directed networks, centrality_incloseness and centrality_outcloseness measure incoming and outgoing closeness.
centrality_incloseness
centrality_outcloseness
centrality_closeness(x, mode = "all", ...)centrality_incloseness(x, ...)centrality_outcloseness(x, ...)
centrality_incloseness(x, ...)
centrality_outcloseness(x, ...)
Named numeric vector of closeness values.
Network input (matrix, igraph, network, cograph_network, tna object).
For directed networks: "all" (default), "in", or "out".
"all"
"in"
"out"
Additional arguments passed to centrality (e.g., normalized, weighted, directed).
centrality
normalized
weighted
directed
centrality for computing multiple measures at once, centrality_harmonic for a variant that handles disconnected graphs.
centrality_harmonic
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3) rownames(adj) <- colnames(adj) <- c("A", "B", "C") centrality_closeness(adj)
Run the code above in your browser using DataLab