Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

betweenness_w

Betweenness centrality in a weighted network


Description

This function calculates betweenness scores for nodes in a weighted network based on the distance_w-function.
Note: This algorithm relies on the igraphs package's implementation of Dijkstra's algorithm. Currently, it does not find multiple shortest paths if two exist.

Usage

betweenness_w(net, directed=NULL, alpha=1)

Arguments

net

A weighted edgelist

directed

logical, whether the network is directed or undirected. Default is NULL, this means that the function checks whether the edgelist is directed or not.

alpha

sets the alpha parameter in the generalised measures from Opsahl, T., Agneessens, F., Skvoretz, J., 2010. Node Centrality in Weighted Networks: Generalizing Degree and Shortest Paths. Social Networks. If this parameter is set to 1 (default), the Dijkstra shortest paths are used. The length of these paths rely simply on the tie weights and disregards the number of nodes on the paths.

Value

Returns a data.frame with two columns: the first column contains the nodes' ids, and the second column contains the nodes' betweenness scores.

Note

version 1.0.0, taken, with permission, from package tnet

Author(s)

References

Examples

## Load sample data
sampledata <- rbind(
c(1,2,1),
c(1,3,5),
c(2,1,1),
c(2,4,6),
c(3,1,5),
c(3,4,10),
c(4,2,6),
c(4,3,10))

## Run the programme
betweenness_w(sampledata)

bipartite

Visualising Bipartite Networks and Calculating Some (Ecological) Indices

v2.16
GPL
Authors
Carsten F. Dormann, Jochen Fruend and Bernd Gruber, with additional code from Stephen Beckett, Mariano Devoto, Gabriel Felix, Jose Iriondo, Tove Opsahl, Rafael Pinheiro, Rouven Strauss and Diego Vazquez, also based on C-code developed by Nils Bluethgen, Aaron Clauset/Rouven Strauss and Miguel Rodriguez-Girones
Initial release
2021-02-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.