igraph-help
[Top][All Lists]
Advanced

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

[igraph] reverse direction of connections


From: Sam Steingold
Subject: [igraph] reverse direction of connections
Date: Mon, 29 Jul 2013 16:33:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>>> 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).

Thanks!

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



reply via email to

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