title: How to merge dataframe lists of unequal length?
body: <p>This question is similar to <a href="https://stackoverflow.com/questions/58934147/joining-dataframes-from-lists-of-unequal-length">Joining dataframes from lists of unequal length</a>.</p>
  <p>I have a <code>shiny</code> script where I am using <code>fileImport</code> to allow the user to import a variable number of data files. Each datafile is then split into a list of dataframes, and these are imported as a list. So I have a list of a list of dataframes.</p>
  <p>The input datafiles have two format possibilities, one may be 129 dataframes long, the other may be 67 - where the 67 is actually a subset of the 129 (so all 67 are present in the 129, but not all 129 are present in the 67). I am then trying to <code>rbind</code> the dataframes by name.</p>
  <p>A reproducible example:</p>
  <pre><code># Some data
  df.l1 &lt;- list(df1 = data.frame(A = letters[1:10],
                                 B = rnorm(10, 5, 1)),
                df2 = data.frame(A = letters[11:20],
                                 B = rnorm(10, 10, 2)))
  
  df.l2 &lt;- list(df1 = data.frame(A = letters[1:10],
                                 B = rnorm(10, 5, 1)),
                df2 = data.frame(A = letters[11:20],
                                 B = rnorm(10, 10, 2)))
  
  df.l3 &lt;- list(df1 = data.frame(A = letters[1:10],
                                 B = rnorm(10, 5, 1)),
                df2 = data.frame(A = letters[11:20],
                                 B = rnorm(10, 10, 2)),
                df3 = data.frame(A = LETTERS[1:10],
                                 B = rnorm(10, 15, 2)))
  </code></pre>
  <p>This works when binding lists of equal length (e.g. df.l1 and df.l2)</p>
  <pre><code>df.two &lt;- list(df.l1, df.l2)
  list.merged &lt;- do.call(function(...) Map(rbind, ...), df.two)
  </code></pre>
  <p>But fails when binding list of dataframes with variables lengths.</p>
  <pre><code>df.three &lt;- list(df.l1, df.l2, df.l3)
  list.merged &lt;- do.call(function(...) Map(rbind, ...), df.three)
  </code></pre>
  <p>Giving the error:</p>
  <pre><code>Warning messages:
  1: In mapply(FUN = f, ..., SIMPLIFY = FALSE) :
    longer argument not a multiple of length of shorter
  2: In mapply(FUN = f, ..., SIMPLIFY = FALSE) :
    longer argument not a multiple of length of shorter
  </code></pre>
  <p>As I said above, similar questions have been asked, but this situation is unique given the variable number of lists I am trying to merge. Help is greatly appreciated!</p>