[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Getting the vertices associated to an edge
From: |
Matt |
Subject: |
Re: [igraph] Getting the vertices associated to an edge |
Date: |
Tue, 30 Jun 2015 00:09:16 +0200 |
Hi Gabor,
Thank you very much for your prompt answer.
What can I do in case I need to get the first vertex of a specific
edge, depending on a label that I set for that edge?
For example I have a graph g whose edges have a label, "label" and I
want to select the first vertex of all these edges.
For selecting the edge I can use the following:
edges = E(g)[which(E(g)$label == value)]
But afterwords? How can I get the first vertex too?
Thank you again.
Best Regards.
Matt
On Mon, Jun 29, 2015 at 7:49 PM, Gábor Csárdi <address@hidden> wrote:
> Hi Matt. In the new version it is called ends(). G.
>
> library(igraph)
> g <- make_ring(10)
>
> ends(g, 1)
> #> [,1] [,2]
> #> [1,] 1 2
>
> ends(g, 3)
> #> [,1] [,2]
> #> [1,] 3 4
>
>
>
> On Mon, Jun 29, 2015 at 7:30 PM, Matt <address@hidden> wrote:
>>
>> Dear All,
>>
>> If I have an edges, is there a way to get its vertices?
>>
>> Thank you very much.
>>
>> Best regards.
>>
>> Matt
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>