[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [igraph] Directed edgelist in ncol format?

**From**: |
Claudia Muller-Birn |

**Subject**: |
[igraph] Directed edgelist in ncol format? |

**Date**: |
Sun, 9 Jan 2011 09:58:40 +0100 |

Dear list,
I have a question regarding data import. I defined a network which is based on
directed, weighted links. I actually simply export all defined networks in a
ncol edge list format. When needed, by using Rsession, I read those edge lists
following :
el <- "matrix(scan(ncol_file_path), byrow=TRUE, ncol=3)"
g <- "graph.data.frame(as.data.frame(el))"
The format I have defined is that the first column contains always the source
of the connection and the second column the drain. O.k., if node X is in the
first column and node Y in the second, then there should be a directed link
from node X to node Y because X sent an email to Y. The third column contains
the weight of this relationship, means in my case the frequency.
In the documentation I found that the ncol format works only with undirected
networks and I wanted to start to implement a Pajek export, well I was
wondering if there is an easier way, and finally here my question:
Is there a way to adapt the above commands in a way that I obtain a directed
network?
Is the command:
g <- "as.directed(g)"
already enough to ensure the above requirement?
I appreciate any help. Thank you very much!
Cheers, Claudia

**[igraph] Directed edgelist in ncol format?**,
*Claudia Muller-Birn* **<=**