Transcript
Page 1: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

Network analysis inR: A tidy approachN E TW OR K AN ALYSIS IN TH E T IDYVE R SE

Massimo Franceschet

Prof. of Data Science, University ofUdine (Italy)

Page 2: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 3: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 4: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 5: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 6: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 7: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Building the network

# load packages for network exploration library(readr) library(igraph) # read nodes and ties data into variables nodes <- read_csv("nodes.csv") ties <- read_csv("ties.csv") # build a network from data frames g <- graph_from_data_frame(d = ties, directed = FALSE, vertices = nodes)

Page 8: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Exploring the network

# explore the set of nodes and print the number of nodes V(g) vcount(g) # explore the set of ties and print the number of ties E(g) ecount(g) # add the name attribute "Madrid network" to the network and print it g$name <- "Madrid network" g$name # add node attribute id and print the node `id` attribute V(g)$id <- 1:vcount(g) # print the tie `weight` attribute E(g)$weight

Page 9: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

Let's start theinvestigation!

N E TW OR K AN ALYSIS IN TH E T IDYVE R SE

Page 10: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

Visualizing networksN E TW OR K AN ALYSIS IN TH E T IDYVE R SE

Massimo Franceschet

Prof. of Data Science, University ofUdine (Italy)

Page 11: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

ggraph()

# load packages for data manipulation and visualization library{igraph) library(dplyr) library(ggplot2) library(ggraph)

# visualize the network ggraph(g, layout = "with_kk") + geom_edge_link(aes(alpha = weight)) + geom_node_point()

Page 12: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 13: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

Let's practice!N E TW OR K AN ALYSIS IN TH E T IDYVE R SE

Page 14: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

Centrality measuresN E TW OR K AN ALYSIS IN TH E T IDYVE R SE

Massimo Franceschet

Prof. of Data Science, University ofUdine (Italy)

Page 15: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 16: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Node centralityWhich are the most important nodes in a network?

Important web pages about a certain topic

In�uential academic papers covering a given issue

Internet routers whose failure would greatly a�ect network connectivity

Page 17: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 18: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Computing degree

# compute node degrees degree(g)

Jamal Zougam Mohamed Bekkali Mohamed Chaoui 29 2 27 Vinay Kholy Suresh Kumar Mohamed Chedadi 10 10 7 Imad Eddin Barakat Abdelaziz Benyaich Abu Abderrahame 22 6 4 Omar Dhegayes Amer Azizi Abu Musad Alsakaoui 2 18 10 Mohamed Atta Ramzi Binalshibh Mohamed Belfatmi 10 10 11 Said Bahaji Galeb Kalaje Abderrahim Zbakh 11 16 15

Page 19: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Page 20: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

NETWORK ANALYSIS IN THE TIDYVERSE

Computing strength

# compute node strengths strength(g)

Jamal Zougam Mohamed Bekkali Mohamed Chaoui 43 2 34 Vinay Kholy Suresh Kumar Mohamed Chedadi 10 10 7 Imad Eddin Barakat Abdelaziz Benyaich Abu Abderrahame 35 7 4 Omar Dhegayes Amer Azizi Abu Musad Alsakaoui 3 27 10 Mohamed Atta Ramzi Binalshibh Mohamed Belfatmi 12 14 19 Said Bahaji Galeb Kalaje Abderrahim Zbakh 17 21 15

Page 21: ti d y a p p r o a c h N e tw o r k a n a l y s i s i n R : A...Dat aCamp Net work A nal ysi s i n t he Ti dyverse Comput i ng degree # compute node degrees degree(g) Jamal Zougam

Let's find the mostcentral terrorists in

the network!N E TW OR K AN ALYSIS IN TH E T IDYVE R SE


Top Related