Learn R Programming

tna (version 0.4.0)

centralities: Calculate Centrality Measures for a Transition Matrix

Description

Calculates several centrality measures. See 'Details' for information about the measures.

Usage

centralities(x, loops = FALSE, normalize = FALSE, measures, ...)

# S3 method for tna centralities(x, loops = FALSE, normalize = FALSE, measures, ...)

# S3 method for matrix centralities(x, loops = FALSE, normalize = FALSE, measures, ...)

# S3 method for group_tna centralities(x, loops = FALSE, normalize = FALSE, measures, ...)

Value

A tna_centralities object which is a tibble (tbl_df). containing centrality measures for each state.

Arguments

x

A tna object, a group_tna object, or a square matrix representing edge weights.

loops

A logical value indicating whether to include loops in the network when computing the centrality measures (default is FALSE).

normalize

A logical value indicating whether the centralities should be normalized (default is FALSE).

measures

A character vector indicating which centrality measures should be computed. If missing, all available measures are returned. See 'Details' for available measures. The elements are partially matched ignoring case.

...

Ignored.

Details

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.

  • 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.

See Also

Core functions build_model(), plot.tna(), plot.tna_centralities(), plot_compare()

Cluster-related functions bootstrap(), cliques(), communities(), deprune(), estimate_cs(), group_model(), hist.group_tna(), mmm_stats(), plot.group_tna(), plot.group_tna_centralities(), plot.group_tna_cliques(), plot.group_tna_communities(), plot.group_tna_stability(), plot_compare.group_tna(), plot_mosaic.group_tna(), plot_mosaic.tna_data(), print.group_tna(), print.group_tna_bootstrap(), print.group_tna_centralities(), print.group_tna_cliques(), print.group_tna_communities(), print.group_tna_stability(), print.summary.group_tna(), print.summary.group_tna_bootstrap(), prune(), pruning_details(), rename_groups(), reprune(), summary.group_tna(), summary.group_tna_bootstrap()

Examples

Run this code
model <- tna(group_regulation)

# Centrality measures including loops in the network
centralities(model)

# Centrality measures excluding loops in the network
centralities(model, loops = FALSE)

# Centrality measures normalized
centralities(model, normalize = TRUE)

Run the code above in your browser using DataLab