linux - Search for multiple terms in R -
i looking way search multiple terms egrep can in r.
for example:
cat fruit | egrep 'apples|grapes|oranges'
you can in r, use grep
function
fruit<-c("apples","bananas","tomatoes","grapes") grep('apples|grapes|oranges', fruit, value=true) # [1] "apples" "grapes"
Comments
Post a Comment