source("./Import Scripts/Game of Thrones Interactions.R")
This is a Game of Thrones character interaction network. The nodes are the characters, and the edges are occasions where the characters interact. Since this network is only interested in whether or not the characters interact, these ties are not directed. The ties are weighted more heavily if the characters have interacted more. The nodes have attributes that indicate what chapters they appear in, what chapters are from their point of view, if they have many chapters from their point of view, and if they are a major character. There are 298 nodes, or characters and 9131 edges between them.
graph.density(network_igraph)
[1] 0.2063363
The overall network density of the Game of Thrones Interactions network is about 0.2. This means that about 20% of the total possible ties(the scenario where everyone knows literally everyone else) are there.
summary(degree(network_igraph))
Min. 1st Qu. Median Mean 3rd Qu. Max.
4.00 29.00 50.50 61.28 80.75 233.00
The most degrees a node has is 233, and the least amount is 4. On average, a node has 61 degrees. That one character has 233 degrees means that this character has met 78 percent of the other characters in the cast. Impressive, considering how quickly characters die in this series.
centr_degree(network_igraph, loops = FALSE, mode="all")$centralization
[1] 0.5820821
The centralization of this network is .58. Since centralization is a scale of 0 to 1, 0 being not at all centered and 1 being fully centralized, this means that the network is more centralized than not.
head(arrange(data.frame(degree(network_igraph)), desc(degree.network_igraph.)), 10)
degree.network_igraph.
Robert Baratheon 233
Eddard Stark 220
Tywin Lannister 213
Robb Stark 212
Jaime Lannister 209
Stannis Baratheon 209
the Others 196
Arya Stark 187
Tyrion Lannister 184
Cersei Lannister 181
The character that meets 233 other characters is none other than Robert Baratheon. In close second, with 220 degrees is Eddard Stark. Interestingly, neither of these characters survived for very long in comparison to the length of the series. But, looking at the list of the top ten most well-connected people in the series, all of them make sense as they are central characters to the plot. Most of the events in the series is a result of Robert Baratheon, Eddard Stark, and the various Lannisters’ machinations.
head(arrange(data.frame(degree(network_igraph)), degree.network_igraph.), 10)
degree.network_igraph.
Iggo 4
Garse Goodbrook 5
Kraznys mo Nakloz 5
Thistle 5
Tytos Frey 5
Talbert Serry 5
Benfred Tallhart 6
Cragorn 6
Prendahl na Ghezn 6
Sallor the Bald 6
And of course, continuing this trend, the bottom 10 least connected people are clearly background characters that are rarely seen more than once. Who is Iggo? I don’t know, and clearly nobody in the series does either.
There seems to be a few things missing from the Game of Throne Interactions import script. One of those things is that it appears that the statnet object does not have an edge matrix associated with it. Look at this sad unconnected network plot for the statnet object,
plot(network_statnet)
and compare it to the connected mess that appears when plotting the igraph object
plot(network_igraph)
I think this has something to do with the fact that the statnet object was made from the igraph object, but I am not sure how to fix this.
This is all the code associated with creating the statnet object. I think I need to use the chapNet.mat variable to fix this, but I am not sure how.
network_statnet <- asNetwork(network_igraph)
delete.edge.attribute(network_statnet, "na")
delete.vertex.attribute(network_statnet, "na")
Another thing that is missing from the output of the script file is the network_adjacency and network_nodes variables. I think nodes are equivalent to the char variable and the adjacency is the chapNet variable, but again, I’m not totally sure. Any guidance on how to fix these issues would make my life a bit easier- trying to do this assignment using only the igraph object was a bit difficult.