The centrality of a node measures the importance of node in the network. As
the concept of importance is ill-defined and dependent on the network and
the questions under consideration, many centrality measures exist.
tidygraph
provides a consistent set of wrappers for all the centrality
measures implemented in igraph
for use inside dplyr::mutate()
and other
relevant verbs. All functions provided by tidygraph
have a consistent
naming scheme and automatically calls the function on the graph, returning a
vector with measures ready to be added to the node data.
centrality_alpha(weights = NULL, alpha = 1, exo = 1, tol = 1e-07,
loops = FALSE)centrality_authority(weights = NULL, scale = TRUE,
options = igraph::arpack_defaults)
centrality_betweenness(weights = NULL, directed = TRUE, cutoff = NULL,
nobigint = TRUE, normalized = FALSE)
centrality_power(exponent = 1, rescale = FALSE, tol = 1e-07,
loops = FALSE)
centrality_closeness(weights = NULL, mode = "out", normalized = FALSE,
cutoff = NULL)
centrality_eigen(weights = NULL, directed = FALSE, scale = TRUE,
options = igraph::arpack_defaults)
centrality_hub(weights = NULL, scale = TRUE,
options = igraph::arpack_defaults)
centrality_pagerank(weights = NULL, directed = TRUE, damping = 0.85,
personalized = NULL)
centrality_subgraph(loops = FALSE)
centrality_degree(weights = NULL, mode = "out", loops = TRUE,
normalized = FALSE)
centrality_edge_betweenness(weights = NULL, directed = TRUE,
cutoff = NULL)
The weight of the edges to use for the calculation. Will be evaluated in the context of the edge data.
Relative importance of endogenous vs exogenous factors
The exogenous factors of the nodes. Either a scalar or a number number for each node. Evaluated in the context of the node data.
Tolerance for near-singularities during matrix inversion
Should loops be included in the calculation
Should the output be scaled between 0 and 1
Settings passed on to igraph::arpack()
Should direction of edges be used for the calculations
maximum path length to use during calculations
Should big integers be avoided during calculations
Should the output be normalized
The decay rate for the Bonacich power centrality
Should the output be scaled to sum up to 1
How should edges be followed. Ignored for undirected graphs
The damping factor of the page rank algorithm
The probability of jumping to a node when abandoning a random walk. Evaluated in the context of the node data.
A numeric vector giving the centrality measure of each node.
centrality_alpha
: Wrapper for igraph::alpha_centrality()
centrality_authority
: Wrapper for igraph::authority_score()
centrality_betweenness
: Wrapper for igraph::betweenness()
and igraph::estimate_betweenness()
centrality_power
: Wrapper for igraph::power_centrality()
centrality_closeness
: Wrapper for igraph::closeness()
and igraph::estimate_closeness()
centrality_eigen
: Wrapper for igraph::eigen_centrality()
centrality_hub
: Wrapper for igraph::hub_score()
centrality_pagerank
: Wrapper for igraph::page_rank()
centrality_subgraph
: Wrapper for igraph::subgraph_centrality()
centrality_degree
: Wrapper for igraph::degree()
and igraph::strength()
centrality_edge_betweenness
: Wrapper for igraph::edge_betweenness()
create_notable('bull') %>%
activate(nodes) %>%
mutate(importance = centrality_alpha())
# Most centrality measures are for nodes but not all
create_notable('bull') %>%
activate(edges) %>%
mutate(importance = centrality_edge_betweenness())
Run the code above in your browser using DataLab