[R] String search: Return "closest" match

Werner Wernersen pensterfuzzer at yahoo.de
Tue Aug 26 13:39:08 CEST 2008


Hi,

I have to match names where names can be recorded with errors or additions.
Now I am searching for a string search function which returns always the "closest" match. E.g. searching for  "Washington" it should return only Washington but not Washington, D.C. But it also could be that the list contains only "Hamburg" but the record I am searching for is "Hamburg OTM" and then we still want to find "Hamburg". Or maybe the list contains "Hamburg" and "Hamberg" but we are searching for "Hamburg" and thus only this should this one should be returned.

agrep() returns all "close" matches but unfortunately does not return the degree of closeness otherwise selection would be easy.
Is there such a function already implemented?

Thanks a million for your help,
  Werner


__________________________
 verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com



More information about the R-help mailing list