I was wondering if you guys can help me building an adjacency matrix. I have data in CVS format like this:
Paper_ID Author
2 Foster-McGregor, N.
3 Van Houte, M.
4 van de Meerendonk, A.
5 Farla, K.
6 van Houte, M.
6 Siegel, M.
8 Farla, K.
11 Farla, K.
11 Verspagen, B.
As you can see the column "Paper_ID" has a repeated value of 11, meaning that "Farla, K." and "Verspagen, B." are coauthors of a publication. I need to build a square weighted matrix using the names of the authors, counting the times that they are collaborating together.
Does the following do what you are looking for?
Note that
crossprod()
will give you the incidence matrix for theid
variable (i.e. will dot(m) %*% m
).