vgrep function

grep, returning values

grep, returning values

vgrep(..., value = TRUE, ignore.case = FALSE)

Arguments

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

Returns

vector of matching values

Details

This function is a simple wrapper around base::grep() which returns matching values. It is particularly helpful when grabbing values from a vector, but where the case (uppercase or lowercase) is known.

Examples

V <- paste0(LETTERS[1:5], LETTERS[4:8]); vgrep("D", V); vgrep("d", V); vigrep("d", V);

See Also

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

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