multi_line_map: str_which for multiple lines

Description Usage Arguments Value Examples

View source: R/utilis.R

Description

this function performs as str_which (no \n in pattern). If there is \n in pattern, the function will try to match corresponding continuous line and return index of the last line matched.

Usage

1

Arguments

string

string. input string to match with. array with each element for a line. must be provided

pattern

string. the pattern to find. \n is in the pattern. must be provided

Value

array. the index location for the last line of the matching block

Examples

1
2
3
4
5
6
7
string=c("aabb","cc","eeab","ce")
pattern="b\\nc"
multi_line_map(string=string,pattern=pattern)
pattern="eea"
multi_line_map(string=string,pattern=pattern)
pattern="eea\\n"
multi_line_map(string=string,pattern=pattern)

artedison/ensRadaptor documentation built on Dec. 8, 2020, 5:31 p.m.