character string containing the pattern to be
matched
x
values to be matched
Value
A logical vector indicating if there is a match or not. This will
mostly be useful in conjunction with the subset function.
Details
Only wildcards matching a single character '?' or zero or more
characters '*' are allowed. Matches are case-insensitive. The
pattern is first converted to a regular expression using
glob2rx then matched to values in x using
grep.
This is a shortcut for a commonly used expression found in the
subset example where nm %in% grep("^M", nm,
value=TRUE) simplifies to nm %like% 'M*'.
data(proks)
subset(proks, name %like% 'Yersinia*', c(name, released))
# also works with date or numeric fieldssubset(proks, released %like% '2008-01*', c(name, released))