How to convert a list of "sequence of vertices" into a vector

I use the Igraph package in R, and when I access the list of vertex names through V (graph), I get the following result:

Vertex sequence: [1] "d66cp96igcdnt25brjeics9d11" "bovlonq25tmuaiak6do92v9cj0" "simj1u4714pa07p38vhstusf36" "6t6tnkoh4ftbgt787pvpmp1323" [5] "mf987tcmm8u8j3pdo4cts6jml3" 

The problem is that I need vectors of these names, but this is structure(1:20, class = "igraph.vs", env = <environment>)

my ideas is to convert it using as.vector (), as.factor failed. Is there any way how to convert it to a string vector?

+6
source share
2 answers

.... Ok, I found a way out:

V(graph)$name will give me a name vector

+14
source

For a more general case, just use the as_ids() function.

+1
source

All Articles