igraph-help
[Top][All Lists]

## Re: [igraph] Plotting an ancestral graph

 From: Tamas Nepusz Subject: Re: [igraph] Plotting an ancestral graph Date: Thu, 17 Jun 2010 23:09:53 +0100

```Hi Alexander,

Okay, for the record: this happens because E(g3) lists edges with the *names*
of the endpoints, not their indices, while get.edge(g3, 2) gives you the
*indices* of the endpoints. So, in your case, you have a graph where vertex 0
has name "1", vertex 1 has name "2" and so on, and this is what you see in
E(g3). V(g)\$name will give you the name vector.

--
T.

On 2010.06.17., at 22:36, Alexander Savi wrote:

> Thank you Tamas. Strangely enough this doesn't seem to work for me, as you
> can see below:
>
> > E(g3)
> Edge sequence:
>
> [0] 1 -> 2
> [1] 2 -> 1
> [2] 2 -> 5
> [3] 3 -> 4
> [4] 4 -> 3
> [5] 4 -> 5
>
> > get.edge(g3, 2)
> [1] 1 4
>
> If I understand you well, get.edge(g3, 2) should produce [1] 2 5. However
> somehow it produces something else which I cannot make sense of.
>
> Alexander
>
>
>
> Alexander Savi | address@hidden | +31 (0)6 55 77 37 37
>
>
> On 17 June 2010 22:39, Tamas Nepusz <address@hidden> wrote:
> > Given the information below, is it possible to single out the number in
> > front of the arrow and the number behind the arrow?
> I've found this, but I'm not sure if this is the only way or there's a better
> way than that:
>
> > get.edge(g3, 0)
> [1] 1 2
> > get.edge(g3, 1)
> [1] 1 4
> ...and so on. get.edge(g3, edge_index)[1] gives you the source, get.edge(g3,
> edge_index)[2] gives you the target. Note that igraph indexes edges and
> vertices from zero, not one; also note that this will change some time in the
> future to become compatible with the rest of R. You can start watching this
> bug report in Launchpad if you are interested in when it will change
> (definitely not before igraph 0.6):
>
>
> --
> Tamas
>
>
> _______________________________________________
> igraph-help mailing list
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
> _______________________________________________
> igraph-help mailing list