powered by
GrepLoop(patternVec, x, ignore.case=TRUE, boolean=FALSE)
grep
x
patternVec
pats <- c("gray", "grey") x <- c("dark gray", "yellow", "light grey", "red") # The first and third elements in x match the patterns GrepLoop(pats, x)
Run the code above in your browser using DataLab