r - Building and adjacency matrix -
i wondering if guys can me building adjacency matrix. have data in cvs format 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 can see column "paper_id" has repeated value of 11, meaning "farla, k." , "verspagen, b." coauthors of publication. need build square weighted matrix using names of authors, counting times collaborating together. does following looking for? # simulate data. d <- data.frame( id=c(2,3,4,5,6,6,8,11,11,12,12), author=c("fn", "vm","va","fk","vm","sm","fk","fk","vb","fk","vb") ) d id author 1 2 fn 2 3 vm 3 4 va 4 5 fk 5 6 vm 6 6 sm 7 8 fk 8 11 fk 9 11 vb 10 12 fk 11 12 vb # create incidence matrix: m ...