[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] adding a new edge attribute with 1 or more zero values dele
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] adding a new edge attribute with 1 or more zero values deletes all edges |
Date: |
Wed, 31 Oct 2012 13:53:45 -0400 |
On Wed, Oct 31, 2012 at 12:47 PM, Gábor Csárdi <address@hidden> wrote:
> On Wed, Oct 31, 2012 at 12:32 PM, Tony Larson <address@hidden> wrote:
>> Thanks Gabor,
>> That's helpful.
>>
>> However, another problem I've run across is setting edge attributes. If I
>> add a new numeric edge attribute with a value of 0 for ANY edge (or all,
>> edges but a single 0 is enough), ALL edges are deleted!
>
> Probably this is a bug, I'll investigate it.
I actually cannot reproduce this. The following all works fine:
library(igraph)
g <- graph.ring(10)
g[1,2,attr="weight"] <- 0
g
el <- get.edgelist(g)
g[from=el[,1], to=el[,2], attr="sim"] <- seq_len(ecount(g))
g
V(g)$name <- letters[seq_len(vcount(g))]
el <- get.edgelist(g)
g[from=el[,1], to=el[,2], attr="sim"] <- seq_len(ecount(g))
g
So I'll need some information on what exactly you did, including toy
data that shows the problem.
Best,
Gabor
[...]