igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] add.edges error message


From: Alisa Coffin
Subject: Re: [igraph] add.edges error message
Date: Sun, 24 Feb 2008 14:52:07 -0500

Thank you for your help Gabor. This was, if fact the problem, but it stemmed from an earlier issue of extracting the information from a GIS network dataset. I used the OID instead of the EID, which I should have used. Then subtracting one made it work out.

Alisa.

On Sat, Feb 23, 2008 at 2:37 PM, Gabor Csardi <address@hidden> wrote:
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.

Gabor

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


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




--
Alisa Coffin, PhD. Candidate
Department of Geography
University of Florida
Gainesville, FL  32611
reply via email to

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