title: R: Join two tables (tibbles) by *list* columns
body: <p>Seems like there should be a simple answer for this but I haven't been able to find one:</p>
  
  <pre><code>tib1 &lt;- tibble(x = list(1, 2, 3), y = list(4, 5, 6))
  tib1
  # A tibble: 3 × 2
        x         y
   &lt;list&gt;    &lt;list&gt;
  1 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  2 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  3 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  
  tib2 &lt;- tibble(x = list(1, 2, 4, 5), y = list(4, c(5, 10), 6, 7))
  tib2
  # A tibble: 4 × 2
        x         y
   &lt;list&gt;    &lt;list&gt;
  1 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  2 &lt;dbl [1]&gt; &lt;dbl [2]&gt;
  3 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  4 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  
  dplyr::inner_join(tib1, tib2)
  </code></pre>
  
  <blockquote>
    <p>Joining, by = c("x", "y")</p>
    
    <p>Error in inner_join_impl(x, y, by$x, by$y, suffix$x, suffix$y) : 
          Can't join on 'x' x 'x' because of incompatible types (list / list)</p>
  </blockquote>
  
  <p>So is there a way to perform a join based on <em>list</em> columns (before I start writing my own)?</p>
  
  <p>Basically if the list of both key variables is identical, I want the row to be included in the final table, and if not - not. In the above example there are two key variables <code>x</code> and <code>y</code> and the result should be only the first row in the two <code>tibble</code>s since it's the only identical one in both key variables:</p>
  
  <pre><code>tibble(x = list(1), y = list(4))
  # A tibble: 1 × 2
        x         y
   &lt;list&gt;    &lt;list&gt;
  1 &lt;dbl [1]&gt; &lt;dbl [1]&gt;
  </code></pre>