get_pat_pos: Get position where search pattern occurs in a file

Description Usage Arguments Value

Description

Given a search pattern and given a file that is specified by its complete path, the positions where the search pattern occurs is returned. Positions correspond to vector indices when the content of the file is read using the function readLines. These vector indices are equivalent to line numbers of the text. In case when the search pattern is not found, NA is returned.

Usage

1
get_pat_pos(ps_file, ps_pattern)

Arguments

ps_file

name of the file to search for pattern

ps_pattern

search pattern for which we search in the file

Value

vec_pos_found vector of positions where pattern occurs, NA if pattern was not found


charlotte-ngs/rmddochelper documentation built on June 27, 2019, 1:22 a.m.