grep: Pattern Matching

Description Usage Arguments Value Constraints See Also Examples

Description

Match pattern in each element of x

Usage

1
2
grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE,
  fixed = FALSE, useBytes = FALSE, invert = FALSE)

Arguments

pattern

string to search for

x

FLVector of characters or R vector where matches are sought

ignore.case

logical indicating case-sensitivity. Currently always FALSE for FLVectors

perl

logical. Should perl-compatible regexps be used? Always FALSE for FLVectors

value

if TRUE value of element is returned rather than indices.

fixed

logical. If TRUE, pattern is a string to be matched as is. For FLVectors, regualar expressions are not supported

useBytes

If TRUE the matching is done byte-by-byte rather than character-by-character. Always FALSE for FLVector

invert

If TRUE return indices or values for elements that do not match.

Value

FLVector or R vector with indices or values where match is found

Constraints

row FLVectors are not supported currently.

See Also

grep for R function reference implementation.

Examples

1
2
3
4
5
widetable  <- FLTable("tblstringID", "stringID")
flv <- widetable[1:6,"string"]
flvector <- grep("A",flv,value=TRUE)
flvector <- grep("A",flv,invert=TRUE)
flvector <- grep("A",flv,invert=TRUE,value=TRUE)

Fuzzy-Logix/AdapteR documentation built on May 6, 2019, 5:07 p.m.