- Use fuzzy string matching to account for spelling mistakes.
Alice will require you to know where to look in your DB for these cases, or talk to make a better Excel file to force people to only input first names (e.g. make a an entry to a cell restricted to a given list).
Fuzzy String Matching
In R, you can use
adist or the
stringdist package. These can be used to measure the distance from an entry (e.g.
Aalice to a list of potential matches
[Alice, Bianca, Chris].
Here is an articles explaining how to use both.
An extract from the article:
# To make sure we are dealing with charts
# It creates a matrix with the Standard Levenshtein distance between the name fields of both sources
dist.name<-adist(source1.devices$name,source2.devices$name, partial = TRUE, ignore.case = TRUE)
# We now take the pairs with the minimum distance
min.name<-apply(dist.name, 1, min)
for(i in 1:nrow(dist.name))
match.s1.s2<-rbind(data.frame(s2.i=s2.i,s1.i=s1.i,s2name=source2.devices[s2.i,]$name, s1name=source1.devices[s1.i,]$name, adist=min.name[i]),match.s1.s2)
# and we then can have a look at the results
All this assumes that you have a list of names that are actually valid.