unigrep function

case-insensitive grep, returning unmatched indices

case-insensitive grep, returning unmatched indices

unigrep(..., ignore.case = TRUE, invert = TRUE)

Arguments

  • ..., ignore.case, invert: parameters sent to base::grep()

Returns

vector of non-matching indices

Details

This function is a simple wrapper around base::grep() which runs in case-insensitive mode, and returns unmatched entries. It is mainly used to save keystrokes, but is consistently named alongside vgrep and vigrep, and quite helpful for writing concise code.

Examples

V <- paste0(LETTERS[1:5], LETTERS[4:8]); unigrep("D", V); igrep("D", V);

See Also

Other jam grep functions: grepls(), igrep(), igrepHas(), igrepl(), provigrep(), unvigrep(), vgrep(), vigrep()

  • Maintainer: James M. Ward
  • License: MIT + file LICENSE
  • Last published: 2025-03-23