igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] igraph: how to select specific edges


From: Gábor Csárdi
Subject: Re: [igraph] igraph: how to select specific edges
Date: Sat, 12 Jan 2013 11:15:11 -0500

On Sat, Jan 12, 2013 at 10:36 AM, Biau David <address@hidden> wrote:
Dear all,

I would like to remove some edges from my network. I would like to remove all edges connecting one specific vertex (e.g., V(g)[type=='a']) to vertices which share a specific characteristic which I have identified (e.g., V(g)[type=='b']) . I haven't found the way to identify these edges.

Any idea?

See ?iterators:

     ‘inc’ takes a vertex sequence as an argument and returns ‘TRUE’
     for edges which have an incident vertex in it.

E.g. 

library(igraph)
g <- graph.ring(10)
E(g)[inc(1)]
# Edge sequence:
#              
# [1]   2 --  1
# [10] 10 --  1

delete.edges(g, E(g)[inc(1)])
# IGRAPH U--- 10 8 -- Ring graph
# + attr: name (g/c), mutual (g/x), circular (g/x)

G.
 
 
David Biau

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help




--
Gabor Csardi <address@hidden>     MTA KFKI RMKI

reply via email to

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