sub: Pattern Matching and Replacement

Description Usage Arguments Details Value Constraints See Also Examples

Description

Replace pattern in each element of x with replacement

Usage

1
2
sub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE,
  fixed = FALSE, useBytes = 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

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

the

replacement character

Details

The DB Lytix function called is FLReplaceChar.The replace character function is a scaler that replaces a character in a string with a another character.

Value

FLVector or R vector after replacement

Constraints

row FLVectors are not supported currently. Currently only one character is used for replacement.

See Also

sub for R function reference implementation.

Examples

1
2
3
widetable  <- FLTable("tblstringID", "stringID")
flv <- widetable[1:6,"string"]
flvector <- sub("A","X",flv)

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