Giter Club home page Giter Club logo

ev-brokerage's Introduction

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

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

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

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

And for the Campnet network case, this would be:

Campnet scores

License

This program is licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE for more information.

Author

Babak Mahdavi Ardestani

[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.