Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

grep

Pattern Matching and Replacement


Description

Search for matches to argument 'pattern' within each element of a character vector.

NOTE: This man page is for the grep and grepl S4 generic functions defined in the BiocGenerics package. See ?base::grep for the default methods (defined in the base package). Bioconductor packages can define specific methods for objects not supported by the default method.

Usage

grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE,
          fixed = FALSE, useBytes = FALSE, invert = FALSE)
grepl(pattern, x, ignore.case = FALSE, perl = FALSE,
          fixed = FALSE, useBytes = FALSE)

Arguments

pattern

The pattern for searching in x, such as a regular expression.

x

The character vector (in the general sense) to search.

ignore.case, perl, value, fixed, useBytes, invert

See ?base::grep for a description of these arguments.

Value

See ?base::grep for the value returned by the default method.

Specific methods defined in Bioconductor packages should behave as consistently as possible with the default method.

See Also

  • base::grep for the default grep and grepl methods.

  • showMethods for displaying a summary of the methods defined for a given generic function.

  • selectMethod for getting the definition of a specific method.

  • BiocGenerics for a summary of all the generics defined in the BiocGenerics package.

Examples

grep  # note the dispatch on 'pattern' and 'x' args only
showMethods("grep")
selectMethod("grep", "ANY")  # the default method

BiocGenerics

S4 generic functions used in Bioconductor

v0.36.1
Artistic-2.0
Authors
The Bioconductor Dev Team
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.