I am using Igraph package in R and when I am accessing the list of vertices names through V(graph), I am getting the following result:
Vertex sequence:
[1] "d66cp96igcdnt25brjeics9d11" "bovlonq25tmuaiak6do92v9cj0" "simj1u4714pa07p38vhstusf36" "6t6tnkoh4ftbgt787pvpmp1323"
[5] "mf987tcmm8u8j3pdo4cts6jml3"
The problem that I need a vectors of these names, but this is structure(1:20, class = "igraph.vs", env = <environment>)
my ideas to transform it with as.vector(), as.factor did not yield a result. Is there a way how to convert it to a vector of strings?
.... Ok, I found a way out:
V(graph)$name
will give me a vector of names
For a more general case, just use the as_ids()
function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With