title: convert from list to dataframe in r
body: <p>I need to dig out similar dataframes from a list and put them into a dataframe. I´ve created a toy example:</p>
  
  <pre><code>nn &lt;- list()
  h &lt;- data.frame(a = c(5,6), j = c(8,1), g = c("d","o"))
  rnz &lt;- c("test1","test2")
  o &lt;- data.frame(a = c(1,2), j = c(6,4), g = c("r","u"))
  rownames(h) &lt;- rnz
  rownames(o) &lt;- rnz
  i &lt;- 1:4
  nn$set1 &lt;- list(num = i, df = h)
  nn$set2 &lt;- list(num = i / 2, df = o)
  </code></pre>
  
  <p>Now I´d like to extract the list into the following tidy format</p>
  
  <pre><code>       var a j
  set1 test1 5 8
  set1 test2 6 1
  set2 test1 1 6
  set2 test2 2 4
  </code></pre>
  
  <p>But - when I do </p>
  
  <pre><code>df &lt;- lapply(nn, function(x) x$df[ , c(1,2)])
  df2 &lt;- lapply(df, function(x) tibble::rownames_to_column(x, "var"))
  
  df3 &lt;- do.call(rbind, lapply(df2, function(c) as.data.frame(c, row.names = NULL)))
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>         var a j
  set1.1 test1 5 8
  set1.2 test2 6 1
  set2.1 test1 1 6
  set2.2 test2 2 4
  </code></pre>
  
  <p>How can I remove remove the .1,.2 etc in the rowcolumn? Is there a neater way of doing this?</p>