Description Usage Arguments Details Value Author(s) See Also Examples
Pattern matching using wildcards
1 | x %like% pattern
|
pattern |
character string containing the pattern to be matched |
x |
values to be matched |
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*'
.
A logical vector indicating if there is a match or not. This will
mostly be useful in conjunction with the subset
function.
Chris Stubben
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.