I want to show how a social network changes over time. I'm using igraph.
The problem is that each time I create a graph representation of a time period within the social network, the program puts the vertices into a different position for each created graph. This is problem because I'm trying to show how social network groups continue/discontinue over time.
I've tried dictating the position of the vertices by typing l<-layout.fruchterman.reingold(g)
then using layout=l
for each subsequent graph I create. However, I get an error message that looks like this:
Error in layout[v, , drop = FALSE] : subscript out of bounds
Here's the code I am using:
require(igraph)
cat<-read.csv(file="Bigplayers_3_36505-36605 - Copy.csv",header=F,sep=",")
cat<-as.matrix(cat)
set.seed(230)
g <- graph.adjacency(cat, weighted=T, mode = "undirected")
g2<-V(g)[degree(g)<1]
g<-delete.vertices(g,g2)
fg<-cluster_fast_greedy(g,merges=T,modularity=T,membership=T)
colors<-rainbow(max(membership(fg)))
V(g)$label<-V(g)$name
plot(g,vertex.size=10,vertex.color=colors[membership(fg)],mark.groups=communities(fg),layout=layout.fruchterman.reingold, main='Enron Email Dataset', vertex.label.dist=0.5, vertex.frame.color='blue', vertex.label.color='black', vertex.label.font=1)
Here are two datasets that represent the same vertices over different time frames: here and here