Learn R Programming

Kmisc (version 0.2.0)

lg: length( grep( ... ) )

Description

This is a wrapper to a length( grep( ... ) ). See examples for usage.

Usage

lg(...)

Arguments

...
passed to grep.

See Also

re.exists

Examples

Run this code
x <- c("apple", "banana", "cherry")
if( lg( "^ap", x ) > 0 ) {
  print( "regular expression '^ap' found in 'x'" )
  }

Run the code above in your browser using DataLab