greplow: greplow - uses tolower in the search for the pattern

View source: R/rutils.R

greplowR Documentation

greplow - uses tolower in the search for the pattern

Description

greplow a grep implementation that ignores the case of either the search pattern or the object to be search. Both are converted to lower case before using grep.

Usage

greplow(pattern, x)

Arguments

pattern
  • the text to search for in x

x
  • the vector or object within which to search for 'pattern' once both have been converted to lowercase.

Value

the index location within x of 'pattern', if it is present, an empty integer if not

Examples

## Not run: 
txt <- c("Long","Lat","LongE","LatE","Depth","Zone","Effort","Method")
greplow("zone",txt)
greplow("Zone",txt)
greplow("long",txt)

## End(Not run)

haddonm/codeutils documentation built on March 10, 2024, 12:14 p.m.