[Top][All Lists]

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

Re: [igraph] add.edges error message

From: Gabor Csardi
Subject: Re: [igraph] add.edges error message
Date: Sat, 23 Feb 2008 20:37:11 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Alisa, without looking at your data, i can only guess that 
this is the infamous "0-based ids" trick. igraph vertices are 
numbered from zero. If indeed this is the problem, then you can solve 
it by subtracting one from the edges:

g2005 <- add.edges(g2005, t(edges2005)-1)

Btw. the error message means that in your edge matrix the ids are
not between 0 and number_of_vertices-1. 


On Sat, Feb 23, 2008 at 02:23:11PM -0500, Alisa Coffin wrote:
> Hello,
> I am brand new to using igraph, and relatively new to R, so please bear with 
> me
> if my question is a simple one. I am building a graph using the example given
> in the "Real world examples" of the igraph introductory material. I have been
> successful so far in creating the graph, adding vertices, and creating a 
> matrix
> of edges. However, when it comes to adding the edges to the graph, I get an
> error message:
> > g2005 <- add.edges(g2005, t(edges2005))
> Error in add.edges(g2005, t(edges2005)) :
>   At type_indexededgelist.c:240 : cannot add edges, Invalid vertex id
> I'm not sure what this means. I have tried looking at the vertex list and the
> edge list and can't seem to find a problem with either. Any ideas? Any
> workarounds?
> Thank you very much!
> Alisa
> --
> Alisa Coffin, PhD. Candidate
> Department of Geography
> University of Florida
> Gainesville, FL  32611

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

Csardi Gabor <address@hidden>    UNIL DGM

reply via email to

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