Learn R Programming

migraph (version 0.8.13)

centrality: Centrality for one- and two-mode networks

Description

These functions calculate common centrality measures for both one- and two-mode networks. They accept as objects matrices and igraph graphs, and can be used within a tidygraph workflow. Importantly, these functions also offer correct normalization for two-mode networks.

Usage

node_degree(
  object,
  weights = NULL,
  mode = "out",
  loops = TRUE,
  normalized = FALSE
)

node_closeness( object, weights = NULL, mode = "out", normalized = FALSE, cutoff = NULL )

node_betweenness( object, weights = NULL, directed = TRUE, cutoff = NULL, nobigint = TRUE, normalized = FALSE )

node_eigenvector( object, weights = NULL, directed = FALSE, options = igraph::arpack_defaults, scale = FALSE, normalized = FALSE )

Arguments

object

Either an igraph graph object or a matrix.

weights

The weight of the edges to use for the calculation. Will be evaluated in the context of the edge data.

mode

How should edges be followed. Ignored for undirected graphs

loops

Should loops be included in the calculation

normalized

For one-mode networks, should Borgatti and Everett normalization be applied?

cutoff

maximum path length to use during calculations

directed

Should direction of edges be used for the calculations

nobigint

Should big integers be avoided during calculations

options

Settings passed on to igraph::arpack()

scale

Should the scores be scaled to range between 0 and 1?

Value

Depending on how and what kind of an object is passed to the function, the function will return a tidygraph object where the nodes have been updated

A numeric vector giving the betweenness centrality measure of each node.

A numeric vector giving the eigenvector centrality measure of each node.

References

Borgatti, Stephen P., and Martin G. Everett. "Network analysis of 2-mode data." Social networks 19.3 (1997): 243-270.

Faust, Katherine. "Centrality in affiliation networks." Social networks 19.2 (1997): 157-191.

See Also

Other two-mode measures: centralization, cohesion, node_constraint(), node_smallworld()

Other node-level measures: node_constraint(), node_smallworld()

Examples

Run this code
# NOT RUN {
node_degree(mpn_elite_mex)
node_degree(southern_women)
node_closeness(mpn_elite_mex)
node_closeness(southern_women)
node_betweenness(mpn_elite_mex)
node_betweenness(southern_women)
node_eigenvector(mpn_elite_mex)
node_eigenvector(southern_women)
# }

Run the code above in your browser using DataLab