[Rsiena-help] how transform edge list to adjacent matrix
Tianhui Huang
thuang at umn.edu
Sun Sep 10 04:58:17 CEST 2017
To whom it may concern,
Thank you for developing Rsinea package, I am a beginner for learning
social network. I use R 3.4.1 version, and RSiena_1.1-232 now. In
my previous work, I usually use igraph package to deal with network data
and familiar with the data has two columns ( source and target).
I am reading the manual of Rsinea now and get confused with how to
transform the edge list to adjacent matrix format. first I am not sure what
does edge list refer to (the data frame with two variables of the source
and target or edges in a graph object). second I am dealing with a directed
graph, I think the adjacent matrix is different from the undirected one,
but still confused how varies?
I used the codes you provide in the manual, but an error occurred, and I
also don't know what's the meaning of the second code.
(# create empty adjacent matrix
adj <- matrix(0, n, n)
# put edge values in desired places
adj[edges[, 1:2]] <- edges[, 3])
I am an international student studying education, so I am not good at
coding, sorry for such a long email. Look forward to receiving your reply
and thank you so much for your help.
Tina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rsiena-help/attachments/20170909/c47c2e51/attachment.html>
More information about the Rsiena-help
mailing list