bestmatch: Best string match using string distance

Description Usage Arguments Details Value

View source: R/clean_functions.R

Description

Find the best match for one character string in a vector of character strings using Levenshtein distance.

Usage

1
bestmatch(string, stringVector)

Arguments

string

elements to be approximately matched: will be coerced to character unless it is a list consisting of integer vectors. Identical to the x parameter in stringdist::amatch()

stringVector

a vector of strings to be used as lookup table for matching. Will be coerced to character unless it is a list consisting of integer vectors. Identical to the table parameter in stringdist::amatch()

Details

The function bestmatch is a quick wrapper around the stringdist::amatch() function using method = "lv" and maxDist = 1

Value

a vector of the same length as string containing the position of the closest match of each element of string in stringVector. Identical to the result returned by stringdist::amatch().


mdtrinh/vietnamdata documentation built on May 3, 2019, 11:49 p.m.