Skip to contents

fuzzy match strings in x to y using optimized string alignment (ignoring capitalization)

Usage

fuzzy_match(x, y, osa_max_dist = 1, ties = c("first", "random", "all"))

fuzzy_match_addr_field(
  x_addr,
  y_addr,
  addr_field,
  osa_max_dist = 0,
  ties = "all"
)

Arguments

x

character vector to match

y

character vector to match to

osa_max_dist

maximum OSA distance to consider a match

ties

if multiple strings in y are tied for the minimum osa distances with a string in x, then specify "first" or "random" as a tiebreaker

x_addr

addr vector to match

y_addr

addr vector to match to

addr_field

character name of addr() field to match on

Value

an integer vector representing the position of the best matching string in y for each string in x; when ties is "all", a list of integer vectors is returned instead

Details

fuzzy_match_addr_field is a helper to match addr vectors using fuzzy_match on a specific field

Examples

fuzzy_match_addr_field(addr(c("3333 Burnet Ave", "3333 Foofy Ave")),
                       addr(c("0000 Main Street", "0000 Burnet Avenue")),
                       "street_name")
#> [[1]]
#> [1] 2
#> 
#> [[2]]
#> [1] NA
#>