find.match: Find a Partial or Exact Match from a Vector of Strings...

Description Usage Arguments Details Value Author(s)

Description

Find a Partial or Exact Match from a Vector of Strings Searches a vector of character-string, and returns the best match.

Usage

1
  find.match(needle, haystack, fail = NA)

Arguments

needle

a character-string to search for in the

haystack

a vector of character-strings

fail

the value to return in case no match is found. Defaults to NA

Details

“find.match” attempts to use several common matching functions in an order that sequentially prefers less strict matching, until a suitable match is found. If none is found, then return the value of the “fail” parameter (defaults to NA). The functions used for matching are: “match”, “charmatch”, and finally “grep”.

Value

the best-matched string or NA

Author(s)

Matt Owen mowen@iq.harvard.edu


IQSS/Zelig4 documentation built on May 9, 2019, 9:13 a.m.