Description Usage Arguments Value See Also Examples
PatternInfo discovers the starting position of each pattern that occurs first or last as well as the number of patterns in each string.
1 | PatternInfo(patterns, strings, rev = FALSE)
|
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. |
Returns a data frame, which contains the length of each string, and the starting position of each pattern in each string.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.