igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Counting edges for each vertex


From: Mulone Moligiangi
Subject: [igraph] Counting edges for each vertex
Date: Sat, 15 Jun 2013 14:05:43 -0400

Hi all, 
 
I'm analysing an e-mail network. I loaded the following information in a directed igraph: 
 
Vertex types: person, e-mail 
V(g)[ type == "person" ] 
V(g)[ type == "email" ] 
 
Edge types: sends, receives 
E(g)[ type == "send" ] 
E(g)[ type == "receive" ] 
 
So for example: 
 
John --send--> email1 --receive--> Mary 
John --send--> email2 --receive--> Mary 
Mary --send--> email3 --receive--> John 
 
I would like to generate a summary of the e-mail activity, with edges with an attribute representing the number of emails: 
 
John --2--> Mary 
Mary --1--> John 
 
I tried to do this, but I haven't figured it out yet. 
I managed to get in/out edges for each letter, but then I don't know what to do to hold a count and how to vectorize the whole process to run it efficiently. 
 
  lapply(V(g)[type=="email"], 
    function(e){ 
      outedges = V(g) [ from(e) ] 
      print(outedges) 
      inedges = V(g) [ to(e) ] 
      print(inedges) 
    }) 
 
I just started using igraph, and I find even basic operations quite difficult to carry out. :-/ 
How would I go about to do that? 
 
Thanks, 
Mulone

reply via email to

[Prev in Thread] Current Thread [Next in Thread]