Load package and data

library(igraph)
## Warning: package 'igraph' was built under R version 3.4.4
## 
## Attaching package: 'igraph'
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
library(readr)
## Warning: package 'readr' was built under R version 3.4.4
edges <- read.csv("SNA_Edges.csv")
head(edges)
##         From      To Times       Area
## 1       Jing      Yu     5         No
## 2   Shixiong      Mu     5         No
## 3    Shreyas    Jing     3         No
## 4     Ashish Vishant     6         No
## 5 Ferinkumar Vishant     1 Don't Know
## 6         Yu    Jing     5         No
nodes <- read.csv("SNA_Node.csv")
head(nodes)
##           ID                 Label
## 1      Aruna Aruna Kumari Gadiraju
## 2     Ashish        Ashish Bathija
## 3     Dmitry      Dmitry Kaleganov
## 4        Duc      Duc Hoang Nguyen
## 5    Enrique    Enrique Cruz Avila
## 6 Ferinkumar      Ferinkumar Patel

In following graph, the width of linked line is based on the collaborate times of two students

Net1 <- graph_from_data_frame(d=edges, vertices=nodes, directed=FALSE)

plot(Net1,
     layout=layout.fruchterman.reingold,
     edge.width=E(Net1)$Times*0.5)

In following graph, if two linked students are from same area, then, the color of linked line would be green, if not, the color would be red, if this information is unknown, it will be black

set.seed(50)
E(Net1)$color <- ifelse(E(Net1)$Area == "Yes", "green", 
                         ifelse(E(Net1)$Area == "No", "red",
                                "black"))
plot(Net1)