r - Get a vertex in a vertex sequnce -



r - Get a vertex in a vertex sequnce -

a vertex sequence igraph seems not sequence. example:

the v sequence v( module.net ) sequence, since can access [deg==1]. why does't work when seek peripheral[1]? possible explanation this?

the dataset illustration not easy included, sorry that.

//

i find answer, index of first vertex 'med24' 4, instead of 1. if want first vertex, have peripheral[1]. seems little unreasonable. replicatable example:

g = graph.ring(5) v(g)$name = c('node1', 'node2', 'node3','node4','node5') temp = v(g)[2:3]

if want access 'node3' temp, have utilize temp[3] instead of temp[2]

i've had problem vertex sequences , border sequences. problem indexing operator on objects is searched vector name, not position. peripheral[1] looking see if vector 1 in list, it's not extracting first element in list.

the best i've come converting sequence simple vector , re-indexing vector list. example

el <- cbind(letters[1:5], letters[c(2,3,5,1,4)]) gg <- graph.edgelist(el) p <- v(gg)[c(2,3)] v(gg)[as.vector(p)[1]]

actually, if want extract name of particular vertex, then

p$name[1]

would work.

r igraph vertex

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -