title: Convert List of Lists to Dataframe Based on 1 List - Every List Different
body: <p>Really struggling to convert a list of lists into a tidy dataframe. I've found various solutions, but none have worked for what I'm specifically trying to do. It also has to be super fast because the dataset is massive.  Here's a snippet of the lists: </p>
  
  <pre><code>$PMID
  [1] "32007943" "32007942" "32007941" "31894091" "31894090"
  
  $Authors
  $Authors[[1]]
    LastName  ForeName Initials order
  1     Ward  Jordan M       JM     1
  2     Hess  Jaclyn N       JN     2
  3    Davis Loretta S       LS     3
  
  $Authors[[2]]
    LastName ForeName Initials order
  1     Pope  Janet E       JE     1
  
  $Authors[[3]]
    LastName ForeName Initials order
  1 Polachek      Ari        A     1
  2     Eder     Lihi        L     2
  
  $Authors[[4]]
    LastName ForeName Initials order
  1 Milchert   Marcin        M     1
  2  Brzosko    Marek        M     2
  
  $Authors[[5]]
    LastName  ForeName Initials order
  1  Pascual    Eliseo        E     1
  2   Andrés   Mariano        M     2
  3   Sivera Francisca        F     3
  
  
  $Year
  [1] 2020 2020 2020 2020 2020
  
  $PublicationType
  $PublicationType[[1]]
    PublicationType 
  "Journal Article" 
  
  $PublicationType[[2]]
  PublicationType 
      "Editorial" 
  
  $PublicationType[[3]]
  PublicationType 
      "Editorial" 
  
  $PublicationType[[4]]
    PublicationType 
  "Journal Article" 
  
  $PublicationType[[5]]
  PublicationType 
      "Editorial" 
  
  </code></pre>
  
  <p>Here is what I want that data to eventually look.  "Authors" should be the observations in the dataframe but it needs to retain the structure, where the group Authors[1] is matched up to PMID[1] and Authors[2] to PMID[2] and so on and so forth. </p>
  
  <pre><code>
    LastName  ForeName Initials order  PMID      Year  Publication_Type
  1     Ward  Jordan M       JM     1  32007943  2020  "Journal Article" 
  2     Hess  Jaclyn N       JN     2  32007943  2020  "Journal Article" 
  3    Davis Loretta S       LS     3  32007943  2020  "Journal Article" 
  4     Pope   Janet E       JE     1  32007942  2020  "Editorial" 
  5  Polachek      Ari        A     1  32007941  2020  "Editorial" 
  6      Eder     Lihi        L     2  32007941  2020  "Editorial" 
  7  Milchert   Marcin        M     1  31894091  2020  "Journal Article" 
  8   Brzosko    Marek        M     2  31894091  2020  "Journal Article"
  9  Pascual    Eliseo        E     1  31894090  2020  "Editorial" 
  1   Andrés   Mariano        M     2  31894090  2020  "Editorial" 
  11  Sivera Francisca        F     3  31894090  2020  "Editorial" 
  
  </code></pre>
  
  <p>Would really appreciate any help! </p>
  
  <p>UPDATE UPDATE: A. Suliman posted a really nice solution, but once I go over 100 extractions it crashes. Very confusing. I'm just posting the whole script and the output: </p>
  
  <pre><code>
  #install.packages("RISmed")
  library(RISmed)
  
  srch_jrheum2020 &lt;- '("The Journal of rheumatology"[Journal]) AND ("2019/01/01"[Date - Publication] : "2020/01/01"[Date - Publication])'
  
  query_jrheum2020 &lt;- EUtilsSummary(
    srch_jrheum2020, 
    retmax=100, 
    mindate= 2000,
    maxdate= 2021,
    datetype = "ppdt")
  
  package_jrheum2020 &lt;- EUtilsGet(query_jrheum2020, type = "efetch", db = "pubmed")
  
  list_jrheum2020 &lt;- list('PMID' = PMID(package_jrheum2020),
                          'Authors' = Author(package_jrheum2020), 
                          'Year' = YearPubmed(package_jrheum2020), 
                          'Month' = MonthPubmed(package_jrheum2020), 
                          'Day' = DayPubmed(package_jrheum2020), 
                          'Journal' = Title(package_jrheum2020),
                          'PublicationType' = PublicationType(package_jrheum2020))
  
  df_jrheum &lt;- pmap_dfr(list_jrheum2020, ~data.frame(
    .y,
    pmid = .x, 
    year = ..3, 
    month = ..4, 
    day = ..5, 
    journal = ..6, 
    type = ..7,
    stringsAsFactors = FALSE))
  
  </code></pre>
  
  <p>So that works beautifully and returns exactly what I want: </p>
  
  <pre><code>
                 LastName          ForeName Initials order     pmid year month day                     journal              type
  1               Milchert            Marcin        M     1 31894091 2020     1   3 The Journal of rheumatology   Journal Article
  2                Brzosko             Marek        M     2 31894091 2020     1   3 The Journal of rheumatology   Journal Article
  3                Pascual            Eliseo        E     1 31894090 2020     1   3 The Journal of rheumatology         Editorial
  4                 Andrés           Mariano        M     2 31894090 2020     1   3 The Journal of rheumatology         Editorial
  5                 Sivera         Francisca        F     3 31894090 2020     1   3 The Journal of rheumatology         Editorial
  6                 Yazici             Yusuf        Y     1 31894089 2020     1   3 The Journal of rheumatology         Editorial
  7                 Mankia           Kulveer        K     1 31787610 2019    12   4 The Journal of rheumatology            Letter
  8                 Briggs       Christopher        C     2 31787610 2019    12   4 The Journal of rheumatology            Letter
  9                  Emery              Paul        P     3 31787610 2019    12   4 The Journal of rheumatology            Letter
  10                 Deane           Kevin D       KD     1 31787609 2019    12   4 The Journal of rheumatology   Journal Article
  11            Demoruelle         M Kristen       MK     2 31787609 2019    12   4 The Journal of rheumatology   Journal Article
  12     Alpizar-Rodriguez           Deshiré        D     1 31787603 2019    12   4 The Journal of rheumatology            Letter
  13                Finckh              Axel        A     2 31787603 2019    12   4 The Journal of rheumatology            Letter
  14                 Dahal            Lekh N       LN     1 31787598 2019    12   4 The Journal of rheumatology            Letter
  15                Barker          Robert N       RN     2 31787598 2019    12   4 The Journal of rheumatology            Letter
  16                  Ward           Frank J       FJ     3 31787598 2019    12   4 The Journal of rheumatology            Letter
  17                  &lt;NA&gt;              &lt;NA&gt;     &lt;NA&gt;    NA 31787596 2019    12   4 The Journal of rheumatology   Journal Article
  18                  &lt;NA&gt;              &lt;NA&gt;     &lt;NA&gt;    NA 31787595 2019    12   4 The Journal of rheumatology   Journal Article
  19                  &lt;NA&gt;              &lt;NA&gt;     &lt;NA&gt;    NA 31787595 2019    12   4 The Journal of rheumatology Published Erratum
  20                 Rabin            Jeff C       JC     1 31787594 2019    12   4 The Journal of rheumatology   Journal Article
  21               Ramirez            Kirsti        K     2 31787594 2019    12   4 The Journal of rheumatology   Journal Article
  22                  Owen          Claire E       CE     1 31787593 2019    12   4 The Journal of rheumatology         Editorial
  23                  Liew         David F L      DFL     2 31787593 2019    12   4 The Journal of rheumatology         Editorial
  24              Buchanan       Russell R C      RRC     3 31787593 2019    12   4 The Journal of rheumatology         Editorial
  25             Falasinnu          Titilola        T     1 31787592 2019    12   4 The Journal of rheumatology         Editorial
  26                Simard           Julia F       JF     2 31787592 2019    12   4 The Journal of rheumatology         Editorial
  27                 Hwang          Steven R       SR     1 31676702 2019    11   5 The Journal of rheumatology            Letter
  28              Sawatsky            Adam P       AP     2 31676702 2019    11   5 The Journal of rheumatology            Letter
  29             Michelena            Xabier        X     1 31676699 2019    11   5 The Journal of rheumatology            Letter
  30         Marco-Pascual             Carla        C     2 31676699 2019    11   5 The Journal of rheumatology            Letter
  31      González-Giménez            Xavier        X     3 31676699 2019    11   5 The Journal of rheumatology            Letter
  32               Juanola            Xavier        X     4 31676699 2019    11   5 The Journal of rheumatology            Letter
  
  </code></pre>
  
  <p>For some crazy reason, if I bump the "retmax" part of the EUtilsSummary function past 100 I get this error: </p>
  
  <pre><code>
  &gt; df_jrheum &lt;- pmap_dfr(list_jrheum2020, ~data.frame(
  +   .y,
  +   pmid = .x, 
  +   year = ..3, 
  +   month = ..4, 
  +   day = ..5, 
  +   journal = ..6, 
  +   type = ..7,
  +   stringsAsFactors = FALSE))
  Error in data.frame(.y, pmid = .x, year = ..3, month = ..4, day = ..5,  : 
    arguments imply differing number of rows: 4, 1, 3
  In addition: There were 50 or more warnings (use warnings() to see the first 50)
  &gt; 
  &gt; warnings()
  Warning messages:
  1: In data.frame(.y, pmid = .x, year = ..3, month = ..4,  ... :
    row names were found from a short variable and have been discarded
  2: In data.frame(.y, pmid = .x, year = ..3, month = ..4,  ... :
    row names were found from a short variable and have been discarded
  3: In data.frame(.y, pmid = .x, year = ..3, month = ..4,  ... :
    row names were found from a short variable and have been discarded
  
  </code></pre>
  
  <p>There are also the annoying warnings about dropping rows, but that seems less consequential. </p>