I have a csv file which has 2 columns, the first and second column contain nodes, each row means the nodes of an edge of an undirected graph. I am new to R, and this is my code:
library(statnet)
dat <- read.csv('Slashdot081106_nosign.csv')
print(head(dat))
net <- as.network(dat, matrix.type="edgelist")
and the console shows:
from to
1 0 1
2 0 2
3 0 3
4 0 4
5 0 5
6 0 6
Error in add.edges.network(g, as.list(x[, 1]), as.list(x[, 2]), edge.check = edge.check) :
(edge check) Illegal vertex reference in addEdges_R. Exiting.
I have searched a lot about this error info, however in vain. Who can tell me how to solve this problem ?
Thanks in advance !