I have a question about how to create a matrix that will take the lists defined below and make them the entries for the columns and rows. My data involves two lists: one lists originals sources (or papers) and the other lists those sources' individual citations.
The code is done in RStudio.
A sample of my original dataset looks like this:
# List all the sources sources.vertices.levels <- cit.total$Sources sources.vertices <- (as.character(sources.vertices.levels)) citation.edges.levels <- cit.total$Citations citation.edges <- (as.character(citation.edges.levels)) # Break up the factors into character lists list.sources <- levels(sources.vertices.levels) list.citations <- levels(citation.edges.levels)
Below I have created an empty matrix (50X1497). I would like to make the row names be each individual source, and the columns be each individual citation.
Also I am lost on how to create a binary matrix that matches each individual source (from the rows) to the individual citations (to the columns).
# Building an aggregate matrix matrix.network <- matrix(cit.citations,ncol=1497, nrow=50)
An example of what kind of matrix I want to do is below: