Re: [R] Comparing/diffing strings

2010-08-24 Thread Hadley Wickham
On Tue, Aug 24, 2010 at 11:25 AM, Martin Morgan wrote: > On 08/24/2010 07:27 AM, Doran, Harold wrote: >> There is the stringMatch function in the MiscPsycho package. >> >>> stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') >> [1] 8 >>> stringMatch('Hadley', 'Hadley Wickham', normalize = 'y

Re: [R] Comparing/diffing strings

2010-08-24 Thread Martin Morgan
On 08/24/2010 07:27 AM, Doran, Harold wrote: > There is the stringMatch function in the MiscPsycho package. > >> stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') > [1] 8 >> stringMatch('Hadley', 'Hadley Wickham', normalize = 'yes') > [1] 0.4285714 > > It uses Levenshtein distance to tel

Re: [R] Comparing/diffing strings

2010-08-24 Thread Doran, Harold
There is the stringMatch function in the MiscPsycho package. > stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') [1] 8 > stringMatch('Hadley', 'Hadley Wickham', normalize = 'yes') [1] 0.4285714 It uses Levenshtein distance to tell you how much they differ by, either normalized or not. S

Re: [R] Comparing/diffing strings

2010-08-24 Thread Ted Harding
On 24-Aug-10 14:16:55, Hadley Wickham wrote: > Hi all, > all.equal is generally very useful when you want to find the > differences between two objects. It breaks down however, > when you have two long strings to compare: > >> all.equal(a, b) > [1] "1 string mismatch" > > Does any one know of an