title: How can I extract elements from lists of lists in R?
body: <p>I have a bunch of lists containing lists within them (generalised linear model output).  I want to write a function which will extract several elements from each list and then combine the results into a data frame. </p>
  
  <p>I want to  extract <code>modelset[[1]]$likelihood</code> &amp; <code>modelset[[1]]$fixef</code>, <code>modelset[[2]]$likelihood</code> &amp; <code>modelset[[2]]$fixef</code>, etc, and combine the results into a data frame.</p>
  
  <p>Can someone give me an idea of how to do this? </p>
  
  <p>Apologies if my question is confusing: what I am trying to do is beyond my limited programming understanding.</p>
  
  <p>Further information about my list: </p>
  
  <pre><code>modelset: Large list (16 elements, 7.3Mb)
      :List of 29
      ..$ fixef           : Named num [1:2] -1.236 -0.611
      .. ..- attr(*, "names")= chr [1:2] "(Intercept)" "SMIstd"
      ..$ likelihood      :List of 4
      .. ..$ hlik: num 238
      .. ..$ pvh : num 256
      .. ..$ pbvh: num 260
      .. ..$ cAIC: num 567
  
      ...etc  
  </code></pre>