grepl.data.frame: Grep a pattern in a full data.frame.

View source: R/grepl.data.frame.R

grepl.data.frameR Documentation

Grep a pattern in a full data.frame.

Description

The function helps to define which rows of an input data.frame contain a specific patter.

Usage

grepl.data.frame(
  data.frame,
  pattern,
  ignore.case = FALSE,
  perl = FALSE,
  fixed = FALSE,
  useBytes = FALSE
)

Arguments

data.frame

Input data.frame.

pattern

Character string containing a regular expression (or character string for fixed = TRUE) to be matched in the given character vector. Coerced by as.character to a character string if possible. If a character vector of length 2 or more is supplied, the first element is used with a warning. Missing values are allowed except for regexpr and gregexpr.

ignore.case

If FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching. By default FALSE.

perl

Logical value to define if Perl-compatible regexps should be used. By default FALSE.

fixed

Logical value to define if the pattern is a string to be matched as is. Overrides all conflicting arguments. By default FALSE.

useBytes

Logical value to define if the matching is done byte-by-byte rather than character-by-character. By default FALSE.

Value

It will be return a logic vector with an element per each row of the data.frame. The value is TRUE when the patter is found at least once in the corresponding data.frame row.

Examples

iris = iris %>% filter(grepl.data.frame(iris, pattern = "setosa"))


sebastian-gregoricchio/Rseb documentation built on May 15, 2024, 5:45 a.m.