closest_matches: Finds the value most similar to 'value' in 'values'.

Description Usage Arguments Value Examples

View source: R/check.R

Description

Uses Levenshtein distance to compare similaririty between strings and will always return a value, even if the similarity score is very low.

Usage

1
closest_matches(value, values, margin = 0, ...)

Arguments

value

A character of length one. The target value used to find the most similar strings in values.

values

A character. The values to selected the most similar to value from.

margin

A numeric, the amount to expand the results by. The default, 0, will return only the lowest similiarity score. Increasing margin will include all values with a similarity score less than similarity_score + margin.

...

Arguments passed through to adist().

Value

A character vector with the subset of values equal to or less than similarity_score + margin.

Examples

1
2
values <- c("dog", "cat", "bird")
closest_matches("cats", values)

hemoshear/assayr2 documentation built on Nov. 8, 2019, 6:13 p.m.