Learn R Programming

Kmisc (version 0.4.0-1)

fgrep: Fixed/Fast Grep

Description

This is equivalent to calling grep with fixed=TRUE.

Usage

fgrep(pattern, x, ignore.case = FALSE, value = FALSE,
    useBytes = FALSE, invert = 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.
value
boolean; if TRUE we return the actual matches; if FALSE we return the indices corresponding to the matches.
useBytes
boolean; if TRUE we perform matching byte-by-byte rather than character by character.
invert
boolean; if TRUE we return indices or values for elements that do not match.

See Also

grep

Examples

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

Run the code above in your browser using DataLab