match_maker: Fuzzy Text Matching: element

Description Usage Arguments Examples

View source: R/match_maker.R

Description

Find the best match (or no match at all) to string inputs.

Usage

1
match_maker(e, matches, max_dist = 5)

Arguments

e

An character

matches

A vector in which to look for matches with e.

max_dist

Set maxDist to be used in stringdist::amatch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
iris <- iris %>% tibble::as_tibble()
iris %>% dplyr::mutate(
  foo = purrr::map_chr(as.character(Species), match_maker,
                matches = c("Virginia", "California", "Sarasota"))
  )

iris %>% dplyr::mutate(
  foo = purrr::map_chr(as.character(Species), match_maker,
                matches = c("Virginia", "California", "Sarasota"), max_dist = 20)
)

aedobbyn/dobtools documentation built on May 28, 2019, 2:33 a.m.