Description Usage Arguments Value Functions Examples
The centrality of a node measures the importance of node in the network. As
the concept of importance is illdefined 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. Further tidygraph
provides access to the netrankr
engine for centrality calculations and
define a number of centrality measures based on that, as well as provide a
manual mode for specifying moreorless any centrality score.
weights 
The weight of the edges to use for the calculation. Will be evaluated in the context of the edge data. 
alpha 
Relative importance of endogenous vs exogenous factors ( 
exo 
The exogenous factors of the nodes. Either a scalar or a number number for each node. Evaluated in the context of the node data. 
tol 
Tolerance for nearsingularities during matrix inversion 
loops 
Should loops be included in the calculation 
scale 
Should the output be scaled between 0 and 1 
options 
Settings passed on to 
directed 
Should direction of edges be used for the calculations 
cutoff 
maximum path length to use during calculations 
nobigint 
Should big integers be avoided during calculations 
normalized 
Should the output be normalized 
exponent 
The decay rate for the Bonacich power centrality 
rescale 
Should the output be scaled to sum up to 1 
mode 
How should edges be followed. Ignored for undirected graphs 
damping 
The damping factor of the page rank algorithm 
personalized 
The probability of jumping to a node when abandoning a random walk. Evaluated in the context of the node data. 
relation 
The indirect relation measure type to be used in 
aggregation 
The aggregation type to use on the indirect relations to be used in 
... 
Arguments to pass on to 
netflowmode 
The return type of the network flow distance, either 
rspxparam 
inverse temperature parameter 
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()
centrality_manual
: Manually specify your centrality score using the netrankr
framework (netrankr
)
centrality_closeness_harmonic
: centrality based on inverse shortest path (netrankr
)
centrality_closeness_residual
: centrality based on 2tothepowerof negative shortest path (netrankr
)
centrality_closeness_generalised
: centrality based on alphatothepowerof negative shortest path (netrankr
)
centrality_integration
: centrality based on 1  (x  1)/max(x) transformation of shortest path (netrankr
)
centrality_communicability
: centrality an exponential tranformation of walk counts (netrankr
)
centrality_communicability_odd
: centrality an exponential tranformation of odd walk counts (netrankr
)
centrality_communicability_even
: centrality an exponential tranformation of even walk counts (netrankr
)
centrality_subgraph_odd
: subgraph centrality based on odd walk counts (netrankr
)
centrality_subgraph_even
: subgraph centrality based on even walk counts (netrankr
)
centrality_katz
: centrality based on walks penalizing distant nodes (netrankr
)
centrality_betweenness_network
: Betweenness centrality based on network flow (netrankr
)
centrality_betweenness_current
: Betweenness centrality based on current flow (netrankr
)
centrality_betweenness_communicability
: Betweenness centrality based on communicability (netrankr
)
centrality_betweenness_rsp_simple
: Betweenness centrality based on simple randomised shortest path dependencies (netrankr
)
centrality_betweenness_rsp_net
: Betweenness centrality based on net randomised shortest path dependencies (netrankr
)
centrality_information
: centrality based on inverse sum of resistance distance between nodes (netrankr
)
centrality_decay
: based on a power transformation of the shortest path (netrankr
)
centrality_random_walk
: centrality based on the inverse sum of expected random walk length between nodes (netrankr
)
centrality_expected
: Expected centrality ranking based on exact rank probability (netrankr
)
1 2 3 4 5 6 7 8  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())

Attaching package: 'tidygraph'
The following object is masked from 'package:stats':
filter
# A tbl_graph: 5 nodes and 5 edges
#
# An undirected simple graph with 1 component
#
# Node Data: 5 x 1 (active)
importance
<dbl>
1 1
2 1
3 1
4 0
5 0
#
# Edge Data: 5 x 2
from to
<int> <int>
1 1 2
2 1 3
3 2 3
# ... with 2 more rows
# A tbl_graph: 5 nodes and 5 edges
#
# An undirected simple graph with 1 component
#
# Edge Data: 5 x 3 (active)
from to importance
<int> <int> <dbl>
1 1 2 2
2 1 3 2
3 2 3 4
4 2 4 4
5 3 5 4
#
# Node Data: 5 x 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.