Ajay Bidyarthy
Ajay Bidyarthy

Reputation: 31

R Function to Replace SPEDIS in SAS

SPEDIS Function in SAS calculates cost as follows (Example):

Example

data words;
input Operation $ Query $ Keyword $;
Distance = spedis(query,keyword);
Cost = distance * length(query);
datalines;

match       fuzzy        fuzzy
singlet     fuzy         fuzzy
doublet     fuuzzy       fuzzy
swap        fzuzy        fuzzy
truncate    fuzz         fuzzy
append      fuzzys       fuzzy
delete      fzzy         fuzzy
insert      fluzzy       fuzzy
replace     fizzy        fuzzy
firstdel    uzzy         fuzzy
firstins    pfuzzy       fuzzy
firstrep    wuzzy        fuzzy
several     floozy       fuzzy
;
proc print data = words;
run;

enter image description here

I am looking for R function which does exactly same thing. Need Help.

Upvotes: 0

Views: 1078

Answers (0)

Related Questions