[Top][All Lists]

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

Re: [igraph] reverse direction of connections

From: Gábor Csárdi
Subject: Re: [igraph] reverse direction of connections
Date: Mon, 29 Jul 2013 16:40:51 -0400

On Mon, Jul 29, 2013 at 4:33 PM, Sam Steingold <address@hidden> wrote:
>>> http://lists.gnu.org/archive/html/igraph-help/2009-03/msg00120.html
>> Is there an easy way to reverse direction of connections in a directed graph?
>el <- get.edgelist(g, names=FALSE)
>g2 <- graph(rbind(el[,2],el[,1]))
>does the job, except that it loses all attributes.

4 years later, is there a better way (I want to keep the attributes, obviously).

get.data.frame() and then graph.data.frame() keeps the attributes.



Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 11.0.11303000
http://www.childpsy.net/ http://pmw.org.il http://americancensorship.org
http://www.memritv.org http://honestreporting.com http://memri.org
A professor is someone who talks in someone else's sleep.

igraph-help mailing list

reply via email to

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