[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Directed edgelist in ncol format?

From: Claudia Muller-Birn
Subject: Re: [igraph] Directed edgelist in ncol format?
Date: Sun, 9 Jan 2011 11:51:01 +0100

Hi Tamás,

Cool. This is what I wanted to hear :) 

You made my day! 


Sent from my iPhone

On 09.01.2011, at 11:27, Tamás Nepusz <address@hidden> wrote:

>> In the documentation I found that the ncol format works only with undirected 
>> networks
> Well, to be more precise: the NCOL format does not convey information about 
> the directedness of the network; in other words, you have to know whether 
> your network is directed or undirected when you load it from NCOL format. But 
> otherwise you can simply save a directed graph in NCOL format if you pass 
> directed=TRUE to read.graph when you load it back. E.g.:
>> g <- barabasi.game(100, 2)
>> is.directed(g)
> [1] TRUE
>> write.graph(g, "test.ncol", format="ncol")
>> g2 <- read.graph("test.ncol", directed=TRUE)
>> graph.isomorphic(g, g2)
> [1] TRUE
> So probably the simplest thing you can do is: g <- 
> read.graph("your_file.ncol", directed=TRUE)
> -- 
> T.
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

reply via email to

[Prev in Thread] Current Thread [Next in Thread]