13.1 Find simple matches with grep

  • Find a pattern anywhere in the string (outputs the index of the element):
## [1] 1
  • Show actual element where the pattern is found (instead of the index only) with value=TRUE:
## [1] "Genomics"
  • Non case-sensitive search with ignore.case=TRUE:
## [1] "Genomics"
  • Show if it DOESN’T match the pattern with inv=TRUE:
## character(0)