title: Mutate with a list column function in dplyr
body: <p>I am trying to calculate the Jaccard similarity between a source vector and comparison vectors in a tibble.  </p>
  
  <p>First, create a tibble with a names_ field (vector of strings).  Using dplyr's mutate, create names_vec, a list-column, where each row is now a vector (each element of vector is a letter).</p>
  
  <p>Then, create a new tibble with column jaccard_sim that is supposed to calculate the Jaccard similarity.</p>
  
  <pre><code>source_vec &lt;- c('a', 'b', 'c')
  
  df_comp &lt;- tibble(names_ = c("b d f", "u k g", "m o c"),
                names_vec = strsplit(names_, ' '))
  
  df_comp_jaccard &lt;- df_comp %&gt;%
     dplyr::mutate(jaccard_sim = length(intersect(names_vec, source_vec))/length(union(names_vec, source_vec)))
  </code></pre>
  
  <p>All the values in jaccard_sim are zero.  However, if we run something like this, we get the correct Jaccard similarity of 0.2 for the first entry:</p>
  
  <pre><code>a &lt;- length(intersect(source_vec, df_comp[[1,2]]))
  b &lt;- length(union(source_vec, df_comp[[1,2]]))
  a/b
  </code></pre>