I guess something like ends(E(g)[ label == value ])[1]
Would do it. There is also head_of and tail_of but they are mixed up in the current version. :( Gabor On Tue, Jun 30, 2015 at 12:09 AM, Matt <[email protected]> wrote: > 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 <[email protected]> > 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 <[email protected]> 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 > >> [email protected] > >> https://lists.nongnu.org/mailman/listinfo/igraph-help > > > > > > > > _______________________________________________ > > igraph-help mailing list > > [email protected] > > https://lists.nongnu.org/mailman/listinfo/igraph-help > > > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help >
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
