- With
el, calculate centrality!
- Use
degree, betweenness, closeness, and evcent
- Which has the highest closeness score?
- Which has the highest eigenvalue centrality score?
el <- data.frame(person_1 = c("Lionel", "Frederica", "Garrett", "Lina",
"Sampson", "Garrett", "Frederica", "Lionel",
"Frederica", "Frederica", "Ahmad"),
person_2 = c("Lina", "Charlotte", "Lina", "Sampson",
"Charlotte", "Lionel", "Lina", "Sampson",
"Sampson", "Garrett", "Garrett")) %>%
as.matrix()
# take a look
el
## person_1 person_2
## [1,] "Lionel" "Lina"
## [2,] "Frederica" "Charlotte"
## [3,] "Garrett" "Lina"
## [4,] "Lina" "Sampson"
## [5,] "Sampson" "Charlotte"
## [6,] "Garrett" "Lionel"
## [7,] "Frederica" "Lina"
## [8,] "Lionel" "Sampson"
## [9,] "Frederica" "Sampson"
## [10,] "Frederica" "Garrett"
## [11,] "Ahmad" "Garrett"
# create network from edge list
net <- graph_from_edgelist(el, directed = FALSE)