Description Usage Arguments Value Examples
Grep, keep or discard a list or vector by pattern
1 2 3 | keep_pattern(x, pattern, ...)
discard_pattern(x, pattern, ...)
|
x |
a list or vector. |
pattern |
string containing a regular expression to be matched in the given character vector. |
... |
additional arguments passed to grepl. |
A list.
1 2 3 | l <- list("David", "Daniel", "Damien", "Eric", "Jared", "Zach")
l %>% keep_pattern("^D")
l %>% discard_pattern("^D")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.