[R] Network Construction in R

elw at stderr.org elw at stderr.org
Mon Sep 24 04:22:22 CEST 2007




> 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]



More information about the R-help mailing list