View source: R/centrality_measures.R
| net_centrality | R Documentation |
Computes centrality measures from a netobject,
netobject_group, or cograph_network. For directed networks
the default measures are InStrength, OutStrength, and Betweenness. For
undirected networks the defaults are Closeness and Betweenness.
net_centrality(x, measures = NULL, loops = FALSE, centrality_fn = NULL, ...)
x |
A |
measures |
Character vector. Centrality measures to compute.
Built-in: |
loops |
Logical. Include self-loops (diagonal) in computation?
Default: |
centrality_fn |
Optional function. Custom centrality function that takes a weight matrix and returns a named list of centrality vectors. |
... |
Additional arguments (ignored). |
For a netobject: a data frame with node names as rows and
centrality measures as columns. For a netobject_group: a named
list of such data frames (one per group).
seqs <- data.frame(
V1 = c("A","B","A","C"), V2 = c("B","C","B","A"),
V3 = c("C","A","C","B"))
net <- build_network(seqs, method = "relative")
net_centrality(net)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.