0
votes

How do I print out all the attributes for the nodes in my vertex sequence?

Given graph g, create an igraph vertex sequence with one vertex:

> (V(g)[1])
+ 1/12761 vertex, named:
[1] 18kPq7GPye-YQ3LyKyAZPw

Where 18kPq7GPye-YQ3LyKyAZPw is the vertex name. However, the vertices in the graph have other attributes as well:

> vertex_attr_names(g)
 [1] "name"  "realname"   "color"   "votes_funny"        

How do I print out all the attributes for the nodes in my vertex sequence?

1
vertex.attributes(g) maybe? Just a guess - Rich Scriven
It would be helpful to include a small reproducible example with sample data. Are you just looking for vertex_attr? - MrFlick
Everybody wants a small reproducible example with sample data. The MIT guy always points people here: stackoverflow.com/questions/5963269/… Really, though I think this is straight-forward enough without the runnable sample. - ahoffer

1 Answers

1
votes

Ah snap! As soon as I posted the question, I found the answer:

> V(g)[[1]]
+ 1/12761 vertex, named:
                    name realname color yelping_since votes_funny votes_useful votes_cool review_count fans
1 18kPq7GPye-YQ3LyKyAZPw   Russel   red            NA         166          278        245   

Use double-brackets! [[ ]]