R/multigrepl.R

Defines functions multigrepl

multigrepl <- function(patterns,
                       x,
                       returnMatchesForPatterns=TRUE,
                       ...) {
  if (returnMatchesForPatterns) {
    bindFun <- rbind;
  } else {
    bindFun <- cbind;
  }
  res <- do.call(bindFun,
                 lapply(patterns,
                        grepl,
                        x=x,
                        ...));
  res <- apply(res,
               1,
               any);
  return(res);
}

Try the justifier package in your browser

Any scripts or data that you put into this service are public.

justifier documentation built on March 7, 2023, 6:59 p.m.