seek: Approximate string matches

seekR Documentation

Approximate string matches

Description

Search for strings using fuzzy matching.

Usage

seekTaxon(x, y, max.distance = 0.3, strip = TRUE, exact = TRUE)
seekTaxa(x, y, max.distance = 0.3, strip = TRUE, exact = TRUE)

Arguments

x

a character.

y

a character to be compared to argument x.

max.distance

see agrep.

strip

if TRUE call stripAll.

exact

if a single exact match are is found, retain only this.

Details

The algorithm proceeds as follows:

  1. Seek matches with agrep and max.distance = 0.05.

  2. If search is empty use dropIntraspecific followed by subsequent calls to asSensuStricto if necessary.

  3. If all these still return no match (the taxon of question might be missing in y) relax string distance to return at least something similar (argument max.distance).

  4. Finally order matches based on stringdist in package stringdist.

If taxon is Genus sp. it has to match precisely.

Value

a named list of approximate matches for each element of argument x retained as list names.

Author(s)

Roland Kaiser

See Also

judgePenalty

Examples

seekTaxon("Leontodon", reference)

seekTaxa(taxa, reference)

kardinal-eros/linktaxa documentation built on Jan. 13, 2024, 9:15 p.m.