As long as I understand the match function is vectorized, hence you don't
need to do a one-by-one search, i.e. instead of sapply(list_of_names,
match, vertex_attr(gt, "name")) you could simply do match(list_of_names,
vertex_attr(gt, "name"))

HIH

George G. Vega Yon
+1 (626) 381 8171
https://ggvy.cl

On Thu, May 3, 2018 at 8:25 AM, Dr Gregory Jefferis <
[email protected]> wrote:

> Thank you, Gabor.
>
> On 2 May 2018, at 17:46, Gábor Csárdi wrote:
>
> > match('1001', vertex_attr(gt, "name"))
>
>   match(1001, vertex_attr(gt, "name"))
>
> is considerably faster than:
>
>   match(1001, names(V(gt))
>
> Best,
>
> Greg.
>
> --
> Gregory Jefferis, PhD
> Division of Neurobiology
> MRC Laboratory of Molecular Biology
> Francis Crick Avenue
> Cambridge Biomedical Campus
> Cambridge, CB2 OQH, UK
>
> http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
> http://jefferislab.org
> http://flybrain.stanford.edu
>
> _______________________________________________
> 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

Reply via email to