PatternInfo: Discovers pattern information in one group of strings

Description Usage Arguments Value See Also Examples

Description

PatternInfo discovers the starting position of each pattern that occurs first or last as well as the number of patterns in each string.

Usage

1

Arguments

patterns

Pattern vector.

strings

String vector.

rev

Determine whether returning the starting positions of patterns that occur first or last in strings. Default is first.

Value

Returns a data frame, which contains the length of each string, and the starting position of each pattern in each string.

See Also

FeaturedPatt

Examples

1
2
3
4
5
6
7
8
9
# simple strings and patterns
strs.vec <- c("ABCDdefABCDa", "def123DC", "123aABCD", "ACD13", "AC1ABC", "3123fe")
patts <- c("ABC", "123")
PatternInfo(patts, strs.vec)

# simple strings and patterns, starting position of last pattern
strs.vec <- c("ABCDdefABCDa", "def123DC", "123aABCD", "ACD13", "AC1ABC", "3123fe")
patts <- c("ABC", "123")
PatternInfo(patts, strs.vec, rev = TRUE)

dstgithub/GrpString documentation built on May 15, 2019, 4:49 p.m.