calcNearestStringDist: Calculate distances to the nearest string

View source: R/RcppExports.R

calcNearestStringDistR Documentation

Calculate distances to the nearest string

Description

Given a character vector, calculate the distance for each element to the nearest neighbor amongst all the other elements.

Usage

calcNearestStringDist(x, metric = "hamming", nThreads = 1L)

Arguments

x

A character vector.

metric

A character scalar defining the string distance metric. One of "hamming" (default), "hamming_shift" or "levenshtein".

nThreads

numeric(1), number of threads to use for parallel processing.

Value

An integer vector of the same length as x.

Examples

calcNearestStringDist(c("lazy", "hazy", "crazy"))
calcNearestStringDist(c("lazy", "hazy", "crazy"), metric = "hamming_shift")
calcNearestStringDist(c("lazy", "hazy", "crazy"), metric = "levenshtein")


fmicompbio/mutscan documentation built on March 30, 2024, 9:13 a.m.