title: R: Reorganise 2D list of dataframes into one dataframe
body: <p>This is possibly a simple question, but most of my R experience is with dataframes and dplyr. I have list of lists, where the inner list contains one 'information' dataframe and one 'results' dataframe (see example below). </p>
  
  <pre><code># Sample code for my data structure
  data &lt;- list(
    list(data.frame(subject = "A", year = 2016),
         data.frame(results = c(1, 2, 3), time = c(4, 5, 6))
    ),
    list(data.frame(subject = "B", year = 2017),
         data.frame(results = c(7, 8, 9), time = c(10, 11, 12))
    )
  )
  </code></pre>
  
  <p>While this has been great for analysing data in inner lists, I've struggled  to do 'cross-list' analysis. What I'm trying to do is reshape my data as shown below.</p>
  
  <pre><code># Dataframes in lists in lists (current)
      [[1]]
      [[1]][[1]]
        subject year
      1       A 2016
      [[1]][[2]]
        results time
      1       1    4
      2       2    5
      3       3    6
      [[2]]
      [[2]][[1]]
        subject year
      1       B 2017
      [[2]][[2]]
  
  # Single dataframe (goal)
        subject year results time
      1       A 2016       1    4
      2       A 2016       2    5
      3       A 2016       3    6
      4       B 2017       7   10
      5       B 2017       8   11
      6       B 2017       9   12
  </code></pre>
  
  <p>I've searched online already, but most of the solutions are of a single list of dataframes not lists of lists.</p>
  
  <p>My best effort so far is using for loops (see below), but as my actual data is <em>much</em> larger (both rows and columns) I'm trying to work out a more efficient solution.</p>
  
  <pre><code>df = data.frame()
  for (i in (1:length(data))) {
    df = rbind(df,
               cbind(data[[i]][[1]], data[[i]][[2]]))
  }
  </code></pre>
  
  <p>Cheers!</p>