find_most_similar_string: find_most_similar_string

Description Usage Arguments Details Value Examples

View source: R/similiars.R

Description

Returns a vector of most similar string in another vector. Returns a vector of the same length as input vector '.s'.

Usage

1
2
3
4
5
6
7
8
9
find_most_similar_string(
  .s,
  .t,
  max_dist = Inf,
  verbose = TRUE,
  ignore_case = TRUE,
  feeling_lucky = FALSE,
  ...
)

Arguments

.s

a character vector to be matched.

.t

a character vector to be matched against.

max_dist

the maximum string distance

verbose

should warnings be printed in the console.

ignore_case

should case be ignored? Default is TRUE.

feeling_lucky

if multiple most similar strings are found. Should the first one be returned?

...

other arguments passed to utils::adist.

Details

Uses the generalized Levenshtein distance. For more information type ?utils::adist in the console.

Value

a character vector

Examples

1
find_most_similar_string(c("battman", "Irn Man"), superheroes)

davidsjoberg/similiars documentation built on Jan. 17, 2021, 6:32 p.m.