title: Join data frames based fuzzy matching of strings
body: <pre><code>library(tidyverse)
  library(fuzzyjoin)
  df1 &lt;- tibble(col1 = c("Apple Shipping", "Banana Shipping", "FedEX USA Ground",
                         "FedEx USA Commercial", "FedEx International"),
                col2 = 1:5)
  #&gt; # A tibble: 5 x 2
  #&gt;   col1                  col2
  #&gt;   &lt;chr&gt;                &lt;int&gt;
  #&gt; 1 Apple Shipping           1
  #&gt; 2 Banana Shipping          2
  #&gt; 3 FedEX USA Ground         3
  #&gt; 4 FedEx USA Commercial     4
  #&gt; 5 FedEx International      5
  
  df2 &lt;- tibble(col3 = c("Banana", "FedEX USA"), col4 = c(700, 900))
  #&gt; # A tibble: 2 x 2
  #&gt;   col3       col4
  #&gt;   &lt;chr&gt;     &lt;dbl&gt;
  #&gt; 1 Banana      700
  #&gt; 2 FedEX USA   900
  </code></pre>
  
  <p>The two data frames I'm working with are shown above. I'd like to fuzzy join them on <code>col1</code> and <code>col3</code> to come up with something similar to what's directly shown below. Basically the rule would be, "<em>If all the text in <code>col3</code> is in any of <code>col1</code> count that as a match</em>".</p>
  
  <pre><code>#&gt; # A tibble: 3 x 4
  #&gt;   col1                  col2  col3      col4
  #&gt;   &lt;chr&gt;                &lt;int&gt;  &lt;chr&gt;    &lt;int&gt;
  #&gt; 1 Banana Shipping          2  Banana     700
  #&gt; 2 FedEX USA Ground         3  FedEx USA  900
  #&gt; 3 FedEx USA Commercial     4  FedEx USA  900
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/32914357/dplyr-inner-join-with-a-partial-string-match">This older SO question appears to offer the solution</a>, but it doesn't quite seem to work in this case and I get the errors shown below:</p>
  
  <pre><code>df1 %&gt;% regex_inner_join(df2, by = c(string = "col3"))
  #&gt; Error: All columns in a tibble must be 1d or 2d objects:
  #&gt; * Column `col` is NULL
  #&gt; Run `rlang::last_error()` to see where the error occurred.
  
  library(stringr)
  df1 %&gt;% fuzzy_inner_join(df2, by = c("string" = "col3"), match_fun = str_detect)
  #&gt; Error: All columns in a tibble must be 1d or 2d objects:
  #&gt; * Column `col` is NULL
  #&gt; Run `rlang::last_error()` to see where the error occurred.
  </code></pre>
  
  <p>How do I perform this fuzzy join with R?</p>