R/matchfuns.R

Defines functions match_ignorecase match_exact match_partial match_partial_ignorecase match_regexp

Documented in match_exact match_ignorecase match_partial match_partial_ignorecase match_regexp

## user-specifiable lookup-functions
match_ignorecase <-
function(lookup, entry, ...)
    tolower(lookup) %in% tolower(entry)

match_exact <-
function(lookup, entry, ...)
    lookup %in% entry

match_partial <-
function(lookup, entry, ...)
    !is.na(pmatch(lookup, entry, ...))

match_partial_ignorecase <-
function(lookup, entry, ...)
    !is.na(pmatch(tolower(lookup), tolower(entry), ...))

match_regexp <-
function(lookup, entry, ...)
    length(grep(lookup, entry, ...)) > 0

Try the registry package in your browser

Any scripts or data that you put into this service are public.

registry documentation built on May 1, 2019, 8:23 p.m.