title: R: merge two lists of lists of dataframes
body: <p>I have two lists of lists of dataframes like this:</p>
  
  <pre><code>L1 &lt;- list(Q1=list(A=data.frame(X1=1:3),C=data.frame(X1=1:3)),
          Q2=list(B=data.frame(X1=1:3),C=data.frame(X1=1:3)))
  L2 &lt;- list(Q1=list(B=data.frame(X1=4:6),C=data.frame(X1=4:6)),
          Q2=list(A=data.frame(X1=4:6),C=data.frame(X1=4:6)))
  </code></pre>
  
  <p>The names on the first level "Q1" and "Q2" are identical in both lists.</p>
  
  <p>I want to merge both lists so that dataframes with same names (e.g. "$Q1$C") will be combined like with <code>rbind</code>, and new ones will be added to the list. The desired output should look like this:</p>
  
  <pre><code>&gt; L3
  $Q1
  $Q1$A
    X1
  1  1
  2  2
  3  3
  
  $Q1$B
    X1
  1  4
  2  5
  3  6
  
  $Q1$C
    X1
  1  1
  2  2
  3  3
  4  4
  5  5
  6  6
  
  
  $Q2
  $Q2$A
    X1
  1  4
  2  5
  3  6
  
  $Q2$B
    X1
  1  1
  2  2
  3  3
  
  $Q2$C
    X1
  1  1
  2  2
  3  3
  4  4
  5  5
  6  6
  </code></pre>
  
  <p>I tried some combinations using <code>Map()</code> and <code>lapply()</code> but I could not fix it, yet. E.g.:</p>
  
  <pre><code>L3 &lt;- Map('rbind',lapply(L1,'['),lapply(L2,'['))
  </code></pre>
  
  <p>Any help is appreciated!</p>