Calculates several centrality measures. See 'Details' for information about the measures.
centralities(x, loops = FALSE, normalize = FALSE, invert = TRUE, measures)# S3 method for tna
centralities(x, loops = FALSE, normalize = FALSE, invert = TRUE, measures)
# S3 method for matrix
centralities(x, loops = FALSE, normalize = FALSE, invert = TRUE, measures)
# S3 method for group_tna
centralities(x, loops = FALSE, normalize = FALSE, invert = TRUE, measures)
A tna_centralities object, which is a tibble (tbl_df) with
one row per state, the column state, and one numeric column per
requested measure (in the order listed in 'Details'). For a group_tna
object, a group_tna_centralities object: the same table for every
group stacked, with the group name in the first column group.
A tna object, a group_tna object, or
a square matrix representing edge weights.
A logical value indicating whether to include loops in the
network when computing the centrality measures. The default is FALSE.
A logical value indicating whether the centralities
should be normalized. The default is FALSE. Diffusion is always
normalized (see 'Details').
A logical value indicating whether the weights should be
inverted for distance-based measures. The default is TRUE.
A character vector indicating which centrality
measures should be computed. If missing, all available measures are
returned. See 'Details' for the available measures.
The following measures are provided:
OutStrength: Outgoing strength centrality, calculated using
igraph::strength() with mode = "out". It measures the total weight
of the outgoing edges from each node.
InStrength: Incoming strength centrality, calculated using
igraph::strength() with mode = "in". It measures the total weight
of the incoming edges to each node.
ClosenessIn: Closeness centrality (incoming), calculated using
igraph::closeness() with mode = "in". It measures how close a node
is to all other nodes based on the incoming paths.
ClosenessOut: Closeness centrality (outgoing), calculated using
igraph::closeness() with mode = "out". It measures how close a node
is to all other nodes based on the outgoing paths.
Closeness: Closeness centrality (overall), calculated using
igraph::closeness() with mode = "all". It measures how close a node
is to all other nodes based on both incoming and outgoing paths.
Betweenness: Betweenness centrality defined by the number of
geodesics calculated using igraph::betweenness().
BetweennessRSP: Betweenness centrality based on randomized shortest
paths (Kivimäki et al. 2016). It measures the extent to which a
node lies on the shortest paths between other nodes.
Diffusion: Diffusion centrality of Banerjee et.al. (2014).
It measures the influence of a node in spreading information through
the network. Diffusion is always min-max normalized to the range
from 0 to 1, whatever the value of normalize, because its raw
values grow with powers of the edge weights (for a frequency model
they easily exceed 1e30). When the raw values are equal for every
state, for example in a relative transition network with
loops = TRUE where every row sums to one, the normalized values are
NaN: the measure does not distinguish the states.
Clustering: Signed clustering coefficient of Zhang and Horvath (2005)
based on the symmetric adjacency matrix (sum of the adjacency matrix
and its transpose). It measures the degree to which nodes tend to
cluster together.
PageRank: Weighted PageRank centrality calculated using
igraph::page_rank() on the directed transition network.
Banerjee, A., Chandrasekhar, A. G., Duflo, E., & Jackson, M. O. (2014). Gossip: Identifying central individuals in a social network. Working Paper.
Kivimaki, I., Lebichot, B., Saramaki, J., & Saerens, M. (2016). Two betweenness centrality measures based on randomized shortest paths. Scientific Reports, 6, 19668. tools:::Rd_expr_doi("10.1038/srep19668")
Zhang, B., & Horvath, S. (2005). A general framework for weighted gene co-expression network analysis. Statistical Applications in Genetics and Molecular Biology, 4(1), Article 17. tools:::Rd_expr_doi("10.2202/1544-6115.1128")
Centrality measure functions
betweenness_network(),
plot.group_tna_centralities(),
plot.tna_centralities(),
print.group_tna_centralities(),
print.tna_centralities()
model <- tna(group_regulation)
# Centrality measures excluding loops in the network (the default)
centralities(model)
# Centrality measures including loops in the network
centralities(model, loops = TRUE)
# Centrality measures normalized
centralities(model, normalize = TRUE)
Run the code above in your browser using DataLab