I have tried to compute the number of neighbors in common between two vertices.
the test file contain
1 2
1 4
1 5
2 3
2 4
2 5
3 4
y<-read.table("test.txt")
require(igraph)
g<-graph.data.frame(y, directed=F, vertices=NULL)
for(i in 1:5)
{
for(j in 1:5)
{
c[i,j]<-cocitation(g,i)[j]
}}
y$neigC<-c[y$V1,y$V2]
But, when I try to add it to a data frame, it fails to give me the correct answer.