title: duplicates in agrep function
body: <p>I have the following code:</p>
  
  <pre><code>x &lt;- data.frame("SN" = 1:2, "Name" = c("aaa","bbb"))
  
  y &lt;- data.frame("SN" = 1:2,  "Name" = c("aa1","aa2"))
  
  x$partials&lt;- as.character(sapply(x$Name, agrep, y$Name,max.distance = 1,value=T))
  
  x
  </code></pre>
  
  <p>The output is the following:</p>
  
  <pre><code>    &gt; x
    SN Name        partials
  1  1  aaa c("aa1", "aa2")
  2  2  bbb    character(0)
  </code></pre>
  
  <p>However I am expecting the following output:</p>
  
  <p><a href="https://i.stack.imgur.com/Bu4PI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bu4PI.png" alt="enter image description here"></a></p>
  
  <p>Any ideas?</p>