Learn R Programming

Kmisc (version 0.4.0-1)

ngrep: Inverse Grep

Description

This is equivalent to calling grep with invert=TRUE.

Usage

ngrep(pattern, x, ignore.case = FALSE, perl = FALSE,
    value = FALSE, fixed = FALSE, useBytes = FALSE)

Arguments

pattern
character string containing a character string to be matched in the given character vector; coerced by as.character if possible.
x
a character vector where matches are sought, or an object coercable by as.character.
ignore.case
boolean; if TRUE we perform case-insensitive matching.
perl
boolean; if TRUE, we use perl-compatible regular expressions.
value
boolean; if TRUE we return the actual matches; if FALSE we return the indices corresponding to the matches.
fixed
boolean; if TRUE the pattern is matched as-is. Overrides all conflicting arguments.
useBytes
boolean; if TRUE we perform matching byte-by-byte rather than character by character.

See Also

grep

Examples

Run this code
ngrep( "abc", c("abc", "babcd", "abcdef", "apple"), value=TRUE )

Run the code above in your browser using DataLab