powered by
Grep, keep or discard a list or vector by pattern
keep_pattern(x, pattern, ...)discard_pattern(x, pattern, ...)
discard_pattern(x, pattern, ...)
a list or vector.
string containing a regular expression to be matched in the given character vector.
additional arguments passed to grepl.
A list.
# NOT RUN { l <- list("David", "Daniel", "Damien", "Eric", "Jared", "Zach") l %>% keep_pattern("^D") l %>% discard_pattern("^D") # }
Run the code above in your browser using DataLab