README.md

targbetween: Targeted Betweenness Centrality

Computes targeted betweenness centrality as described in Britt et al. (2021).

If you use this package, please cite the original manuscript:

Britt, B. C., Hayes, J. L., Musaev, A., Sheinidashtegol, P., Parrott, S., & Albright, D. L. (2021). Using targeted betweenness centrality to identify bridges to neglected users in the Twitter conversation on veteran suicide. Social Network Analysis and Mining, 11, article 40. Retrieved from https://doi.org/10.1007/s13278-021-00747-x

Installation

To use this package, first install and load it in R with

install.packages("devtools")
library(devtools)
install_github("bcbritt/targbetween")
library("targbetween")

Usage

To compute targeted betweenness centrality, you need to indicate the network to be analyzed and the dyads that will be evaluated. There are two basic approaches depending on the nature of the dyads to be evaluated:

  1. If the set of dyads consist of one of more "source" vertices and one or more "destination" vertices, and each of your source vertices shares a dyad with every destination vertex, then use targbetween_alldyads, specifying the set of "source" and "destination" vertices to be evaluated. An appropriate set of dyads for this analysis might look like the following:
Source Destination
Ashley Diana
Ashley Emily
Bart   Diana
Bart   Emily
Chris  Diana
Chris  Emily
  1. If you cannot define a set of "source" and "destination" vertices such that every source vertex shares a dyad with every destination vertex, then use the more general (but much less efficient) targbetween function instead. This approach is necessary if the set of dyads to be evaluated is more like the following:
Source Destination
Ashley Bart
Ashley Chris
Bart   Ashley
Chris  Diana
Diana  Ashley
Diana  Emily

Required Arguments

You can call each of these two functions as follows:

Source Destination
Ashley Diana
Ashley Emily
Bart   Diana
Bart   Emily
Chris  Diana
Chris  Emily
dyads <- rbind(c("Ashley","Bart"),c("Ashley","Chris"),c("Bart","Ashley"),c("Chris","Diana"),c("Diana","Ashley"),c("Diana","Emily"),)
targbetween(my_network, dyads)

The above code block will compute targeted betweenness centrality for the my_network network graph using the following set of dyads:

Source Destination
Ashley Bart
Ashley Chris
Bart   Ashley
Chris  Diana
Diana  Ashley
Diana  Emily

Optional Arguments

targbetween_alldyads(my_network, c("Ashley","Bart","Chris"), c("Diana","Emily"), filename = "C:/Users/Admin/Desktop/output.csv")
targbetween(my_network, dyads, directed = TRUE, update = 1000)


bcbritt/targbetween documentation built on April 21, 2021, 6:12 p.m.