lg: length( grep( ... ) )

Description Usage Arguments See Also Examples

View source: R/misc.R

Description

This is a wrapper to a length( grep( ... ) ). See examples for usage. Primarily intended for interactive, not programmatic, use.

Usage

1
lg(pattern, x, perl = TRUE, ...)

Arguments

pattern

regex pattern passed to grep.

x

a vector on which we attempt to match pattern on.

perl

boolean. use perl-compatible regular expressions?

...

additional arguments passed to grep.

See Also

re_exists

Examples

1
2
3
4
x <- c("apple", "banana", "cherry")
if( lg( "^ap", x ) > 0 ) {
  print( "regular expression '^ap' found in 'x'" )
  }

Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to lg in Kmisc...