title: Access centrality measures attributes in list of networks
body: <p>I am studying the evolution of weighted and undirected networks over time. I have managed to create a list of networks and to compute different centrality measures stored as node attributes, but I don't know how to extract those to study them in more depth.</p>
  <p>Here is a small sample of my data:</p>
  <pre><code>el_cc &lt;- data.frame(from = c(&quot;BEL&quot;, &quot;LUX&quot;, &quot;FRN&quot;, &quot;UKG&quot;,&quot;BEL&quot;, &quot;LUX&quot;, &quot;FRN&quot;, &quot;UKG&quot;),
                      to = c(&quot;FRN&quot;, &quot;UKG&quot;, &quot;DEN&quot;, &quot;CND&quot;,&quot;FRN&quot;, &quot;UKG&quot;, &quot;DEN&quot;, &quot;CND&quot;),
                      weight = c(1,2,3,4,5,6,7,8),
                      year = c(2010,2010,2010,2010,2011,2011,2011,2011))
  </code></pre>
  <p>To prepare the data and create the graphs, I run</p>
  <pre><code>cc &lt;- split(el_cc, el_cc$year)
  
  get.graphs &lt;- function(data){
    # Select columns
    data[(names(data) %in% c(&quot;from&quot;, &quot;to&quot;, &quot;weight&quot;))]
    
    # Remove duplicate dyads
    data &lt;- data %&gt;% 
      rowwise() %&gt;% 
      mutate(tmp = paste(sort(c(from,to)), collapse = ''))
    data &lt;- data[!duplicated(data$tmp),]
    data$tmp &lt;- NULL
    
    # Create graph
    g &lt;- graph_from_data_frame(data, directed = FALSE)
  
    # Degree centrality
    g$degreecent &lt;- degree(g, mode=&quot;total&quot;, normalized = TRUE)
    
    # Betweenness centrality
    g$betweenness &lt;- betweenness(g, v = V(g), directed = FALSE, nobigint = TRUE, normalized = TRUE)
    
    # k-core
    g$kcore &lt;- coreness(g, mode=&quot;all&quot;)
    
    return(g)
  }
  
  graph.cc &lt;- lapply(cc, get.graphs)
  </code></pre>
  <p>If I try to view elements of <code>graph.cc</code>, I get an error</p>
  <pre><code>Error in adjacent_vertices(x, i, mode = if (directed) &quot;out&quot; else &quot;all&quot;) : 
    At iterators.c:763 : Cannot create iterator, invalid vertex id, Invalid vertex id
  Error in adjacent_vertices(x, i, mode = if (directed) &quot;out&quot; else &quot;all&quot;) : 
    At iterators.c:763 : Cannot create iterator, invalid vertex id, Invalid vertex id
  </code></pre>
  <p>But if I run the line below, it seems to be fine.</p>
  <pre><code>graph.cc$`2011`
  </code></pre>
  <p>But then, from here, I don't know how to access the centrality measures I computed. I have seen plenty of tutorials that show how to use the attributes to plot the network, but I would like to store them in a dataframe for instance or in a list of dataframes. If I was not using a list but if I was working one year at the time, here is what I would do:</p>
  <pre><code># For one year at a time
  
  degreecent &lt;- degree(g, mode=&quot;total&quot;, normalized = TRUE)
  betweenness &lt;- betweenness(g, v = V(g), directed = FALSE, nobigint = TRUE, normalized = TRUE)
  kcore &lt;- coreness(g, mode=&quot;all&quot;)
  Centrality_Measures &lt;- data.frame(degreecent, betweenness , kcore , stringsAsFactors=FALSE)
  
  </code></pre>
  <p>Ideally, I would like to build on this to obtain a list of dataframe with the centrality measures for all nodes over the years.
  Many thanks in advance!</p>