Skip to main content

builtin_agrep

Function builtin_agrep 

Source
fn builtin_agrep(
    args: &[RValue],
    named: &[(String, RValue)],
) -> Result<RValue, RError>
Expand description

Approximate grep: search for approximate pattern matches in a character vector.

Uses Levenshtein edit distance to find elements that approximately match the pattern. By default, the maximum distance is 10% of the pattern length (R’s default for max.distance = 0.1).

@param pattern character scalar: pattern to approximately match @param x character vector to search @param max.distance numeric: maximum edit distance (< 1 means fraction of pattern length) @param value logical: if TRUE, return matching elements instead of indices @param ignore.case logical: if TRUE, matching is case-insensitive @return integer vector of indices (default) or character vector of matching elements