2

I have a csv file structured in the following way:

id  Author                Contribution  Coauthors
1   Anders B.             0.111111111   9
1   Blatt I.              0.111111111   9
1   Chung S.S.            0.111111111   9
1   Clark A.M.            0.111111111   9
1   Fakhoury T.A.             0.111111111   9
1   Halvorsen M.B.            0.111111111   9
1   Laine D.              0.111111111   9
1   Lawson B.             0.111111111   9
1   Nagaraddi V.              0.111111111   9
1   Hogan R.E.            0.111111111   9
2   Isaksson A.           0.5           2
2   Kaulich F.            0.5           2
2   Foster-McGregor N.    0.5           2
3   Van Houte M.              0         0
4   van de Meerendonk A.      1         1
4   Koning P.             1         1

where id = paper unique identifier.

I would like to create in R a weighted adjacency matrix where the links between each couple of authors are weighted in the following way:

Weight i,j = SUM for all id of [link i,j (0,1) / (Number coauthors of each id -1)]  
Sven Hohenstein
  • 80,497
  • 17
  • 145
  • 168
  • What is your question? – Emer Dec 10 '14 at 16:57
  • 3
    It's a bit hard for me to understand the weight function. What does `link` mean in that case? Can you give a short example of weighted matrix? – romants Dec 10 '14 at 17:18
  • I do a similar stuff and use the Python package `networkx` to do this. – MERose Dec 10 '14 at 18:59
  • sorry, I was not clear!The first column identifies the paper, the second colum identifies the number – Francesca Rubiconto Dec 11 '14 at 11:11
  • Possible duplicate of [R iGraph: How to get weighted adjacency matrix from a graph?](https://stackoverflow.com/questions/48423635/r-igraph-how-to-get-weighted-adjacency-matrix-from-a-graph) – Eric Fail Feb 12 '18 at 20:01

0 Answers0