Description Usage Arguments Details Examples
Extract values from a vector that match a particular pattern.
1 | match_pattern(x, pattern, unique_only = FALSE, ...)
|
x |
A vector, typically of class |
pattern |
Character string specifying the particular pattern to match. |
unique_only |
Logical indicating whether or not to only return unique
values. Default is |
... |
Additional optional arguments to ba passed onto
|
The pattern specified by the required argument pattern
must be a valid
pattern produced by the get_pattern
function. That is, all digits
should be represented by a "9"
, lowercase/uppercase letters by a
"a"
/"A"
, etc.
1 2 3 | phone <- c("123-456-7890", "456-7890", "123-4567", "456-7890")
match_pattern(phone, pattern = "999-9999")
match_pattern(phone, pattern = "999-9999", unique_only = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.