igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Problems with deleting vertices


From: Gábor Csárdi
Subject: Re: [igraph] Problems with deleting vertices
Date: Thu, 2 Aug 2012 10:07:25 -0400

On Thu, Aug 2, 2012 at 9:56 AM, Julian Hagenauer
<address@hidden> wrote:
> Hello,
> somehow igraph does not delete vertices for me.
> Am i doing something wrong?
>
>> g<-graph.ring(10)
>> vcount(g)
> [1] 10
>> delete.vertices(g,c(2,7,8))
> IGRAPH U--- 7 5 -- Ring graph
> + attr: name (g/c), mutual (g/x), circular (g/x)
>> vcount(g)
> [1] 10

R functions do not modify objects in place. They return the result.
I.e. you need to write this:

newg <- delete.vertices(g, c(2,7,8))

Gabor

[...]
-- 
Gabor Csardi <address@hidden>     MTA KFKI RMKI



reply via email to

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