I have huge list of edges with weights.
a1 b1 w1
a2 b2 w2
a3 b3 w3
a1 b1 w4
a3 b1 w5
I have to convert it into 2 dim matrix
     b1                b2          b3
a1  max(w1,w4)   0           0
a2            0        w2         0
a3        w5          0           w3

if edges repeated take the maximum weights. How do this efficiently without
using for loop? Any idea.

thanks
Avi

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to