Description Usage Arguments Value Examples
This is a convenient wrapper around x[re2_detect(x, pattern)]
. Vectorised over strings and patterns.
1 2 |
string |
a character vector |
pattern |
a character vector or pre-compiled regular expressions |
anchor |
see |
omit_na |
omit na result |
parallel |
use multithread |
grain_size |
a minimum chunk size for tuning the behavior of parallel algorithms |
... |
further arguments passed to |
A character vector.
1 2 3 4 5 6 7 8 | fruit <- c("apple", "banana", "pear", "pinapple")
re2_subset(fruit, "a")
re2_subset(fruit, "^a")
re2_subset(fruit, "a$")
re2_subset(fruit, "b")
re2_subset(fruit, "[aeiou]")
re2_subset(c("a", NA, "b"), ".")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.