0

I am trying to implement social network analysis and have arranged the data in the format wherein the data set has 3 columns with first indicating the sender and second indicating the receiver and third indicating the strength of the message being sent between 2 parties.

In all if i treat (overall) distinct parties from 2 columns as no of nodes in my network and try to plot the relationship (messages sent between 2 parties) as the edges .

so my data looks like ( as an example): A B C 123 456 7 345 346 10

where sender 123 has sent 7 messages to party no 456 and party no 345 has sent 10 messages to party no 346

so my overall 4 different participants are there and among them 2 edges exist

Now in true problem i have such (as explained above) 3384 nodes and 3287 edges

so i initialise the network as net<-network.initialize(num_nodes)

and when i initiate net[edge_list]<-1 I face the error: "Error in if ((v<1)|| (v>n)) return(numeric(0)): missing value where TRUE/FALSE needed

it would be great if one can help in resolution of this error.

skyebend
  • 1,079
  • 6
  • 19
sarora
  • 9
  • 1
  • It is kind of hard to tell how your edgelist data is formatted, perhaps you could edit the question to make that part clearer? – skyebend May 26 '16 at 21:41
  • It isn't clear from your example how the "A B C" fits into this, are they node labels? – skyebend May 26 '16 at 21:47
  • Clarifying the source of that information or its structure would help others understand your problem better. – pbahr May 26 '16 at 23:08

1 Answers1

0

It looks like you are using the wrong function to create edges. the net[] address the network as if it was an adjacency matrix, and you are passing in and edgelist. Assuming that your edgelist is a matrix or data.frame like

123 456 7 
345 346 10

Then you can probably added the edges with something like:

net <- addEdges(net, tail=edge_list[,1], head=edge_list[,2], names.eval='msg_count', vals.eval=edge_list[,3])
skyebend
  • 1,079
  • 6
  • 19