multi_grepl {mark} | R Documentation |
Multiple searching
Description
Multiple search pattern searches
Usage
multi_grepl(x, patterns, ..., simplify = TRUE)
multi_grep(x, patterns, ..., simplify = TRUE)
Arguments
x |
Passed to |
patterns |
A list or vector of patterns to search across |
... |
Additional arguments passed to |
simplify |
if |
Value
The name or position of the pattern that is matched
Examples
x <- c("apple", "banana", "lemon")
multi_grepl(x, c("a" = "^[ab]", "b" = "lem"))
multi_grepl(x, c("a" = "^[ab]", "b" = "q")) # lemon not matches on either
multi_grepl(x, c("a" = "^[ab]", "b" = "e")) # apple matches "a" before "b"
multi_grepl(x, c("a" = "^[ab]", "b" = "e"), simplify = FALSE) # shows all matches
multi_grepl(x, c("^[ab]", "e")) # returned as positions
multi_grepl(x, c("^[ab]", "e"), simplify = FALSE)
[Package mark version 0.8.0 Index]