title: How to list all graph vertex attributes in R?
body: <p>I am using the <a href="http://igraph.sourceforge.net/doc/R/attributes.html" rel="noreferrer">igraph</a> package in R.</p>
  
  <p>I would like to associate some data with each vertex, e.g. by adding id and description attributes to each.  The attributes are determined at runtime.  I have a couple of related questions about how to set and get this data.</p>
  
  <p>To set a vertex's id I use (where <code>g</code> is a graph):</p>
  
  <pre><code>&gt; set.vertex.attribute(g,'id',1,'first_id') # etc
  </code></pre>
  
  <p>I expected to be able to read the attributes back with:</p>
  
  <pre><code>&gt; get.vertex.attribute(g,'id',1)
  </code></pre>
  
  <p>But this returns NULL. Am I doing something wrong?</p>
  
  <p>Further, the function with the <code>get.vertex.attribute</code> call does not have access to the list of attribute names. How can I extract the attribute names from the graph <code>g</code>?</p>
  
  <p>Finally, I want to set/get the values of the attributes from/into a named list.  Is there a simple way to do that without looping through every vertex and attribute and applying <code>set.</code>- or <code>get.vertex.attribute</code>?</p>
  
  <p>thanks!</p>