case-insensitive logical grepl

igrepl(..., ignore.case = TRUE)

Arguments

..., ignore.case

parameters sent to base::grep()

Value

logical vector indicating pattern match

Details

This function is a simple wrapper around base::grepl() which runs in case-insensitive mode simply by adding default ignore.case=TRUE. It is mainly used for convenience.

See also

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

Examples

V <- paste0(LETTERS[1:5], LETTERS[4:8]);
ig1 <- grepl("D", V);
ig2 <- igrepl("D", V);
ig3 <- grepl("d", V);
ig4 <- igrepl("d", V);
data.frame(V,
   grepl_D=ig1,
   grepl_d=ig3,
   igrepl_D=ig2,
   igrepl_d=ig4);
#>    V grepl_D grepl_d igrepl_D igrepl_d
#> 1 AD    TRUE   FALSE     TRUE     TRUE
#> 2 BE   FALSE   FALSE    FALSE    FALSE
#> 3 CF   FALSE   FALSE    FALSE    FALSE
#> 4 DG    TRUE   FALSE     TRUE     TRUE
#> 5 EH   FALSE   FALSE    FALSE    FALSE