unvigrep: case-insensitive grep, returning unmatched values

unvigrepR Documentation

case-insensitive grep, returning unmatched values

Description

case-insensitive grep, returning unmatched values

Usage

unvigrep(..., ignore.case = TRUE, value = TRUE, invert = TRUE)

Arguments

..., ignore.case, value, invert

parameters sent to base::grep()

Details

This function is a simple wrapper around base::grep() which runs in case-insensitive mode, and returns unmatched values. It is mainly used to save keystrokes, but is consistently named alongside vgrep and vigrep, and quite helpful for writing concise code. It is particularly useful for removing unwanted entries from a long vector, for example removing accession numbers from a long vector of gene symbols in order to review gene annotations.

Value

vector of non-matching indices

See Also

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

Examples

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


jmw86069/jamba documentation built on March 26, 2024, 5:26 a.m.