Get string distances, optionally using multiple cores

dedup_get_stringDistances(
  x,
  y = x,
  stringDistanceMethod = "osa",
  parallel = FALSE,
  silent = metabefor::opts$get("silent")
)

Arguments

x

The first vector

y

The second vector

stringDistanceMethod

The method to use ("osa", "lv", "dl", "hamming", "lcs", "qgram", "cosine", "jaccard", "jw", or "soundex")

parallel

Whether to use parallel processing

silent

Whether to be silent or chatty

Value

A data frame with the string distances between the elements, with the first vector determining the rows, and the second vector, the columns.

Examples

### Create two vectors with strings
a <- c("Apple", "Blueberry", "Cherry", "Date");
b <- c("Airplane", "Bus", "Cycle");

dedup_get_stringDistances(
  a,
  b
);
#> Error in dedup_get_stringDistances(a, b): To deduplicate, you need the `stringdist` package! You can install it with:
#> 
#>   install.packages('stringdist');