Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/babak2/ev-brokerage
Everett & Valente brokerage scores for directed & undirected graphs
https://github.com/babak2/ev-brokerage
graph-measures network-metrics r social-network-analysis social-network-visualization
Last synced: 2 months ago
JSON representation
Everett & Valente brokerage scores for directed & undirected graphs
- Host: GitHub
- URL: https://github.com/babak2/ev-brokerage
- Owner: babak2
- License: gpl-3.0
- Created: 2019-12-07T22:24:54.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T17:51:06.000Z (5 months ago)
- Last Synced: 2024-07-15T21:55:13.645Z (5 months ago)
- Topics: graph-measures, network-metrics, r, social-network-analysis, social-network-visualization
- Language: R
- Homepage:
- Size: 2.18 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EV Brokerage
Using betweenness centrality as an underpinning concept, *Everett and Valente (2016)* propose a new brokerage measure and explore its relationship to classic betweenness.
This package contains simple R code for calculating *Everett and Valente (2016)* brokerage scores for both undirected and directed graphs.
For more information about the brokerage measure, see:
**Everett MG, Valente TW.** *Bridging, brokerage, and betweenness.* Social Networks. 2016; 44:202-208. DOI: [10.1016/j.socnet.2015.09.001](https://doi.org/10.1016/j.socnet.2015.09.001)
## Installation
Clone the repository to your local machine:
`git clone https://github.com/babak2/EV-brokerage.git`
or if you have the program as a ZIP file, simply extract the zip file to a directory of your choice.
Change your working directory to EV-brokerage:
`cd EV-brokerage`
## Program Requirements
R or RStudio with the following libraries installed:
`tidygraph`, `igraph`, `ggraph`# Usage
Open EV-brokerage.R in R or RStudio
## Inputs/Parameters:
`g`: a graph (of type igraph or tidygraph).
`as.graph` (optional): By default, the result is returned as a data frame. To obtain the result as a graph, set as.graph to TRUE.
`all.values` (optional): By default, it is set to FALSE. If set to TRUE, it will include all the other calculated values in addition to EV brokerage scores.
`as.graph` (optional): By default, the results are returned as a DataFrame; if set to TRUE, the output will be returned as a graph.
## Output/Returns:
The score as a DataFrame (by default) or as a graph if as.graph is set to TRUE.
If the original graph has original IDs (names), the results will include the original IDs (names).
## Provided RDS data:
`granovetter_graph.RDS`: This dataset contains the undirected graph of the Granovetter hypothetical network as shown in Figure 1 of Everett & Valente (2016) article
![Granovetter network](./images/granovetter.png)
`campnet_graph.RDS`: This dataset contains the directed graph of the Campnet hypothetical network as shown in Figure 3 of Everett & Valente (2016) article.
![Campnet network](./images/campnet.png)
## Examples:
g <- readRDS("granovetter_graph.RDS")
g <- readRDS("campnet_graph.RDS")
res.df <- ev_brokerage(g)
To obtain the result as graph:
res.g <- ev_brokerage(g, as.graph=TRUE)
Use all.values=TRUE to include other calulated values in addition to EV brokerage scores:
res.df <- ev_brokerage(g, all.values=TRUE)
With all.values=TRUE, you obtain the entire scores and other values (if IDs are included in the graph datasets). For example, for the Granovetter network case, this would be:
![Granovetter scores](./images/table1.png)
And for the Campnet network case, this would be:
![Campnet scores](./images/table2.png)
## License
This program is licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE for more information.
## Author
Babak Mahdavi Ardestani