 <p>Use <code>agrep</code> function.</p> <p>Initial data:</p> <pre><code>x &lt;- c("Company A Pty.","BigData GMBH","Company A Pty. Ltd.","Red Pants Warsaw", "Company A Georgia", "Red Pants Ltd", "BlueSocks House") </code></pre> <p>first argument is pattern that you want to look in data (eg x[1]), second is where you want to look, <code>max</code> is the max distance two strings can differ. <code>value</code> means that we want to obtain strings instead of indexes of vector.</p> <p>If there is no match, you can change <code>max</code>, but be careful! More is not always better.</p> <pre><code>agrep(x[1],x, max=0.1, value=TRUE) ## [1] "Company A Pty." "Company A Pty. Ltd." agrep(x[1],x, max=0.3, value=TRUE) ## [1] "Company A Pty." "Company A Pty. Ltd." "Company A Georgia" agrep(x[1],x, max=0.7, value=TRUE) ## [1] "Company A Pty." "Company A Pty. Ltd." "Company A Georgia" "Red Pants Ltd" </code></pre> <p>What's more, this is not symetrical. "Red Pants Warsaw" (x[4]) was not matched to "Red Pants Ltd" (x[6]) but it worked other way - x[6] was matched to x[4]. Be aware of this.</p> <pre><code>agrep(x[4],x, max=0.2, value=TRUE) ## [1] "Red Pants Warsaw" agrep(x[6],x, max=0.2, value=TRUE) ## [1] "Red Pants Warsaw" "Red Pants Ltd" </code></pre>