R/grep_or.R

grep_or <- function (x, patterns) {
    lp = lapply(patterns, function(i) grepl(i, x))
    res = 0
    for (i in lp) res = res + i
    x[res > 0]
}

Try the do package in your browser

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

do documentation built on Aug. 3, 2021, 5:06 p.m.