Description Usage Arguments Value Examples
View source: R/filter_element.R
Removes the matching elements of a vector.
1 | filter_element(x, pattern, ...)
|
x |
A character vector. |
pattern |
A regex pattern to match for exclusion. |
... |
Other arguments passed to |
Returns a vector with matching elements removed.
1 2 3 4 5 | x <- c('dog', 'cat', 'bat', 'dingo', 'dragon', 'dino')
filter_element(x, '^d.+?g')
filter_element(x, 'at$')
filter_element(x, '^d')
filter_element(x, '\\b(dog|cat)\\b')
|
[1] "cat" "bat" "dino"
[1] "dog" "dingo" "dragon" "dino"
[1] "cat" "bat"
[1] "bat" "dingo" "dragon" "dino"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.