> I am trying to construct a social network from a data frame with rows
>
>        acra numa acrb numb year    expab eabo    impab iabo
> 10       USA    2  CAN   20 1957 4017.000  0.0 3187.000  0.0
> 91       USA    2  CUB   40 1957  628.000  0.0  526.000  0.0
> 144      USA    2  HAI   41 1957   25.000  0.0   20.000  0.0
>
> and so on.
>
> I want the network to have directed edges from node acra to node acrb 
> weighted by expab. What is the most convenient way to construct this 
> network object?


Depends, I expect, on what you want to do with it.   Building a matrix 
from acra to acrb with expab as the matrix value (aka "tie strength") 
wouldn't be all that crazy.

Depending on which of the R network bits you are choosing to use, and the 
size of your data, different strategies are going to be more suitable than 
others.

Generally there is good support for converting different representations 
- edgelist, matrix, etc - and between them.  Some of those conversion 
methods don't work so well if the data is very large, however... you'll 
find that the ones that rely on processing a full matrix are particularly 
problematic, I expect.

--elijah

[School of Library and Information Science, Indiana University 
Bloomington]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to