title: Join data frames over a third dimension by row/column names
body: <p>I have an arbitrary number of data frames, with row and column names.</p>
  
  <p>My goal is to join those data frames using row/column names as join key, over a third dimension, ie, I want the result to be a named three dimensional array.</p>
  
  <p>My problem is that I don't want to join them <strong>positionally</strong> but by their row/column names.</p>
  
  <p>I know I can use <strong>abind()</strong> for concatenating arrays along any desired dimension, but abind concatenates data <strong>positionally</strong>, not by dimname.</p>
  
  <p>In sql terms, I want a full join using row/column names as join keys, but along a third dimension.</p>
  
  <p>Here you have a small reproducible example with only two data frames:</p>
  
  <pre><code>first &lt;- data.frame(one=c(1,2), two=c(3,4), row.names = c("one", "two"))
  second &lt;- data.frame(one=c(10,20), three=c(50,60), row.names = c("one", "three"))
  result &lt;- someMagicFunction(first, second)
  </code></pre>
  
  <p>My desired output for the "result" object is:</p>
  
  <pre><code>result &lt;- array(data=c(1, 2, NA, 3, 4, NA, NA, NA, NA,
                         10, NA, 20, NA, NA, NA, 50, NA, 60), 
                  dim = c(3, 3, 2), 
                  dimnames = list(
                    c("one", "two", "three"),
                    c("one", "two", "three"),
                    c("first", "second")))
  &gt; result
  , , first
  
        one two three
  one     1   3    NA
  two     2   4    NA
  three  NA  NA    NA
  
  , , second
  
        one two three
  one    10  NA    50
  two    NA  NA    NA
  three  20  NA    60
  </code></pre>
  
  <p>I have written a function by myself to accomplish the task, but I would like to know if there is already any built-in function to do that.</p>
  
  <p>Thanks!</p>