#' Perform grepl on multiple patterns; it's like AND-ing or OR-ing successive grepl statements.
#'
#' Adapted from https://stat.ethz.ch/pipermail/r-help/2012-June/316441.html
#'
#' @param pattern character vector of patterns
#' @param x the character vector to search
#' @param op logical vector operator back quoted, defaults to `|`
#' @param ... further arguments for \code{grepl} like \code{fixed} etc.
#' @return logical vector
mgrepl <- function(pattern, x, op = `|`, ... ){
Reduce(op, lapply(pattern, grepl, x, ...))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.