PatternInfo {GrpString} | R Documentation |
Discovers pattern information in one group of strings
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
PatternInfo(patterns, strings, rev = FALSE)
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
Examples
# 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)
[Package GrpString version 0.3.2 Index]