igraph-help
[Top][All Lists]
Advanced

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

[igraph] Regarding combining weights of undirected inverted edges


From: Anurag Passi
Subject: [igraph] Regarding combining weights of undirected inverted edges
Date: Thu, 2 Jun 2016 21:17:56 -0400

Hello,

I am new to igraph and I have a rather trivial query. I have a data in the format:

Source Target Weight
A         B        0.1
B         A        0.3
A         B        0.4

I want to combine these rows so that I have one edge (undirected) between A and B and the Weight is the AVERAGE of the weights of the edges between A and B and only one edge representing the connection between A and B. Something like:

Source Target Weight
A          B      (0.1+0.4+0.3)/3

I have used aggregate(), as.undirected() functions but nothing seems to work as the Weights tend to get lost during conversion from table to graph.

Please help.

Regards,
Anurag

--
Anurag Passi
Sr. Research Fellow
OSDD, CSIR
00-91-9899767938
skype: anurag.passi

reply via email to

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